Hi All,
I apologise if this has been asked elsewhere.
The recase() function doesn't work the way I expect when doing title case.
In the below example I expected the result to be: "Bbc The Making Of King Arthur" which would fall in line with the help. See attachment.
Am I misinterpreting what recase() should do or is there a setting I need to change?
Cheers
John
Recase() function
Recase() function
- Attachments
-
- XY Recase.PNG (22.24 KiB) Viewed 1209 times
Windows 8.1 x64
XYplorer 22.90.0105 beta
XYplorer 22.90.0105 beta
Re: Recase() function
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Recase() function
Are you unhappy with the changes? I might extend SC recase() to give you more control.
FAQ | XY News RSS | XY Twitter
Re: Recase() function
Another flag to disregard the entries of the tweak would be nice...
One of my scripts helped you out? Please donate via Paypal
-
- Site Admin
- Posts: 60357
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: Recase() function
Went this way:
Code: Select all
+ SC recase enhanced: Added parameter "title_case_exceptions".
Syntax: recase(string, [mode], [flags], [title_case_exceptions])
title_case_exceptions:
missing: Use the global defaults (as stored at key RenameTitleCaseExceptions)
empty: Do not use any exceptions
else: Use this ";"-separated list of exceptions, e.g. "a;an;the"
Examples for Title Case:
text recase("the caMel BITES the horse.", "t"); //The Camel Bites the Horse. (factory default exceptions)
text recase("the caMel BITES the horse.", "t", , ""); //The Camel Bites The Horse. (no exceptions)
text recase("the caMel BITES the horse.", "t", , "the;bites"); //The Camel bites the Horse. (custom exceptions)
Examples for Camel Case:
text recase("the caMel BITES the horse.", "c"); //The CaMel BITES the Horse. (factory default exceptions)
text recase("the caMel BITES the horse.", "c", , ""); //The CaMel BITES The Horse. (no exceptions)
text recase("the caMel BITES the horse.", "c", , "the;bites"); //The CaMel bITES the Horse. (custom exceptions)
FAQ | XY News RSS | XY Twitter
Re: Recase() function
Hi Don,
I think the change is a good one, but extending the function is a great idea. Thanks
I think the change is a good one, but extending the function is a great idea. Thanks
Windows 8.1 x64
XYplorer 22.90.0105 beta
XYplorer 22.90.0105 beta
Re: Recase() function
Don, I have a query on the new behavior of recase, when it is used with a string that has a period in it, the function seems to always make the last word lowercase (maybe assumes its an extension?), should that happen even when the flag is not set? eg:
Code: Select all
text recase("word.word.word.word", "t"); // EXPECT ALL TO BE TITLE CASE
text recase("word.word.word.word", "t", 1); // EXPECT ALL EXCEPT LAST WORD TITLE CASE