#1 2014-08-18 07:43

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,161

Wish: WideCaseSentence() PascalScript function

I want to bring two issues to your attention.


1.) Related to

Wiki wrote:

http://www.den4b.com/wiki/ReNamer:Pasca … g_Handling
function WideCaseCapitalize(const S: WideString): WideString; 
Returns the Sentence case version of the WideString S.
Only the first alphabetic character is capitalized. All other alphabetic characters are converted to lowercase.

I would suggest to change the description to something like:

Stefan wrote:

function WideCaseCapitalize(const S: WideString): WideString; 
Returns the Title case version of the WideString S.
The first letter of each word in a string is capitalized.

With title case you capitalise the first letter of each word. This Is Title Case.


2.) Please implement a new function like:

Stefan wrote:

function WideCaseSentence(const S: WideString): WideString; 
Returns the Sentence case version of the WideString S.
Only the first alphabetic character of a string is capitalized. All other alphabetic characters are converted to lowercase.

Sentence case is when you only capitalise the first letter of the  first word in a heading
– like you would in a sentence. This is sentence case.




That would help in writing code instead of:

  FirstPart  := WideCopy(BaseName, 1, PosHyphen +1);
  SecondPart := WideLowerCase(WideCopy(BaseName, PosHyphen +2, 999));

      Parts := SubMatchesRegEx(SecondPart, '(.*?[a-z])(.+)', FALSE);
      If (Length(Parts) <=0) then exit;
      SecondPart   := WideUpperCase(Parts[0]) + Parts[1];

as just

  FirstPart  := WideCopy(BaseName, 1, PosHyphen +1);
  SecondPart := WideCaseSentence(WideCopy(BaseName, PosHyphen +2, 999));


Thanks.


Read the  *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)

Offline

#2 2014-08-18 23:58

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,479

Re: Wish: WideCaseSentence() PascalScript function

* WideCaseSentence added.
* Description for WideCaseCapitalize has been fixed in the wiki.

The description was completely wrong before, thanks for pointing this out!

Offline

Board footer

Powered by FluxBB