Page 1 of 1

upperInitial Issue

Posted: 04 Apr 2024, 11:51
by Spudinc
Apologies if this has been asked already, but here goes.

I've been using {t.upperInitial} as part of my episode when renaming TV show files, however it's capitalising letters after ' in the filename so I end up with for example "We'Re" rather than "We're". English is set as my default language and from what I've found online "We're" should be the default unless I've missed something.

Currently using this formatting:

Format: Select all

{drive}/{(n.upperInitial()).replace(':':' -')}{" {tvdb-$id}"}/{'Season '+s}/{(n.upperInitial()).replace(':':' -')} - {S00E00} - {t.upperInitial()}
Thanks in advance for your help.

Re: upperInitial Issue

Posted: 04 Apr 2024, 14:41
by rednoah
You can do your own pattern replacement, if the built-in helpers don't work for you for one reason or another.

e.g. upper-case characters and the beginning and after space:

Format: Select all

{ "we're the world".replaceAll(/(?<=^|\s)\w/){ it.upper() } }



EDIT:

Thank you for reporting the issue. FileBot r10220 will fix String.upperInitial() to make "we're" and the like work as expected.

Re: upperInitial Issue

Posted: 05 Apr 2024, 01:21
by Spudinc
Noticed that "I'll" also returns "I'Ll"

Re: upperInitial Issue

Posted: 05 Apr 2024, 02:53
by rednoah
Thanks, I'll add that to the list of exceptions.