RE: function to convert first letter of each word in a s tring

"Shkolnik M." <[email protected]>
Newsgroups gmane.comp.lang.delphi.programming
Message-ID <[email protected]>
Use the next code:

function Proper(strStr: string): string;
var
  IsStartWord: Boolean;
  i: Integer;
  ch: Char;
begin
  IsStartWord := True;
  Result := '';
  if (Length(strStr) > 0) then
    for i := 1 to Length(strStr) do
    begin
      if IsStartWord then
        ch := AnsiUpperCase(strStr[i])[1]
      else
        ch := AnsiLowerCase(strStr[i])[1];
      IsStartWord := (ch = ' ');
      Result := Result + ch;
    end;
end;

For example, ShowMessage('george bush w');

With best regards, Mike Shkolnik
EMail: [email protected]
http://www.scalabium.com


-----Original Message-----
From: cstakdk [mailto:[email protected]] 
Sent: Friday, July 18, 2003 2:57 PM
To: [email protected]
Subject: [Delphi] function to convert first letter of each word in a string


hi...

if the user enter a name and surname into the text like geroge bush w
i need the result in George Bush W

Is there any function in Delphi(i am new comer in delphi)
Please advice me
thanks
thanks for the pervious answers 
csta

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Coral Calcium for Greater Health. 1 month supply - $23.95
(1 bottle, 90 tablets, 400mg each with Magnesium & Vitamin D)
http://www.challengerone.com/t/l.asp?cid=2805&lp=calcium2.asp
http://us.click.yahoo.com/mcIe3D/v9VGAA/ySSFAA/i7folB/TM
---------------------------------------------------------------------~->

CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
--------------------------------------------------------------- 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.