Page 1 of 1

selective renaming of series name with {n.upperInitial()}

Posted: 23 Jul 2014, 06:56
by hellraiser
There are many series where the naming goes

Game of Thrones, Through the Wormhole etc where I need the words like of,the to be lowercase only but {n.upperInitial()} changes all initials to uppercase

There are some series where all uppercase are needed. example - Last.Week.Tonight.With.John.Oliver.S01E11.HDTV.x264-BATV

here I need {n.upperInitial()} ( i.e. I need 'with' to be uppercase) but also want to add exceptions for 'of','the'

Is there any way I could do this?

Thanks!!

Re: selective renaming of series name with {n.upperInitial()

Posted: 23 Jul 2014, 07:16
by rednoah
At this point why don't you just keep {n} untouched?

Hint:

Code: Select all

{'Game Of Thrones'.replace('Of','of')}

Re: selective renaming of series name with {n.upperInitial()

Posted: 23 Jul 2014, 07:23
by hellraiser
At the moment it is just {n} :P but is there no except() function in groovy that would get the job done?

Code: Select all

{'Game Of Thrones'.replace('Of','of')}
This works for one time then I have to change...better I keep it only {n} and manually change one or two words