Page 1 of 1

Acronym with prefix 'T'

Posted: 06 Jun 2018, 09:45
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 ;)

Re: Acronym with prefix 'T'

Posted: 06 Jun 2018, 09:56
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}+/, '')

Re: Acronym with prefix 'T'

Posted: 06 Jun 2018, 21:16
by Crys
Thanks for that quick and accurate solution :D