本文整理自网络,侵删。
function TitleCase(const s : string) : string; var i : integer; begin if s = '' then Result := '' else begin Result := Uppercase(s[1]); for i := 2 to Length(s) do if s[i - 1] = ' ' then Result := Result + Uppercase(s[i]) else Result := Result + Lowercase(s[i]); end; end; As in: procedure TForm1.Button1Click(Sender: TObject); begin Edit1.Text := TitleCase('the quick brown fox jumped over the lazy dog'); end; 相关阅读 >>
Delphi2010中使用pchar时e2010 incompatible types: 'char' and 'ansichar' 错误的处理
Delphi webbrowser1 querystatuswb
更多相关阅读请进入《Delphi》频道 >>