Acronym with prefix 'T'

Any questions? Need some help?
Post Reply
Crys
Posts: 5
Joined: 06 Jun 2018, 08:57

Acronym with prefix 'T'

Post by Crys »

Hello.
sometimes I get episodes with a "The" as first word like: The Walking Dead, The Expanse, The Man in the High Castle, ...
When I convert files with "acronym().n", then it get shortened to "WD", "E", "MintHC", ... without the prefix 't'.
But I prefer to have an acronym with all letters: "TWD", "TE", "TMintHC", ...

Is it possible to say, that 'acronym()' shouldn't crop the 'The' in the front?

An other idea: is it possible to make a list of episodes names with the preferred acronyms?
Example: 'Deep Space Nine' to 'DS9'

thanks ;)
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Acronym with prefix 'T'

Post by rednoah »

e.g. implement it yourself:

Code: Select all

n.replaceAll(/\s|\B\p{Alnum}+/, '')
Test Case:

Code: Select all

'The Walking Dead'.replaceAll(/\s|\B\p{Alnum}+/, '')
:idea: Please read the FAQ and How to Request Help.
Crys
Posts: 5
Joined: 06 Jun 2018, 08:57

Re: Acronym with prefix 'T'

Post by Crys »

Thanks for that quick and accurate solution :D
Post Reply