ESBProperStr Function |
Unit
QESBPCSConvert
Declaration
Function ESBProperStr(const S: string): string;
Description
Words are seen as being delimited by WordSepSet which you can alter.
Parameters |
S | the String to have its case adjusted. |
Category
Extra String Handling RoutinesImplementation
function ESBProperStr (const S: string): string; var I: LongWord; First: Boolean; begin First := True; Result := AnsiLowerCase (S); // Convert string to lower case for I := 1 to Length (S) do if not (Result [I] in WordSepSet) then // check for character that is part of word begin if First then // Only capitalise if first word begin First := False; Result [I] := AnsiUpCase (Result [I]); end; end else // Character is a Word Separator and we start again First := True; End; |
|