upperInitial Issue

Any questions? Need some help?
Post Reply
Spudinc
Posts: 3
Joined: 04 Apr 2024, 11:09

upperInitial Issue

Post 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.
User avatar
rednoah
The Source
Posts: 23008
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: upperInitial Issue

Post 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.
:idea: Please read the FAQ and How to Request Help.
Spudinc
Posts: 3
Joined: 04 Apr 2024, 11:09

Re: upperInitial Issue

Post by Spudinc »

Noticed that "I'll" also returns "I'Ll"
User avatar
rednoah
The Source
Posts: 23008
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: upperInitial Issue

Post by rednoah »

Thanks, I'll add that to the list of exceptions.
:idea: Please read the FAQ and How to Request Help.
Post Reply