ESBProperStr Function
Returns Proper String - each word Capitalized - uses Ansi Capitalisation.

Unit
QESBPCSConvert

Declaration
Function ESBProperStr(const S: string): string;

Description
Words are seen as being delimited by WordSepSet which you can alter.

Parameters
the String to have its case adjusted.

Category
Extra String Handling Routines

Implementation

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;


HTML generated by Time2HELP
http://www.time2help.com