delphi 英文单词第一个字母大写


本文整理自网络,侵删。

 
function PROPER(S: string): string;

const

Symbols = ' _;.,1234567890';

var

X: Integer;

begin

Result := '';

if Length(s) = 0 then

   exit;

S[1] := AnsiUpperCase(s[1])[1];

for X := 1 to length(s) do

   if POS(S[x], Symbols) <> 0 then

   begin

     if X <> Length(s) then

       S[x + 1] := AnsiUpperCase(s[x + 1])[1];

   end

   else

     S[x + 1] := AnsiLowerCase(S[x + 1])[1];

Result := S;

end;



//补充:第二种实现方法
function ToMixCase(InString: string): string;

var

I: Integer;

begin

Result := LowerCase(InString);

Result[1] := UpCase(Result[1]);

for I := 1 to Length(InString) - 1 do

begin

   if (Result[I] = ' ') or (Result[I] = '''') or (Result[I] = '"')

     or (Result[I] = '-') or (Result[I] = '.') or (Result[I] = '(') then

     Result[I + 1] := UpCase(Result[I + 1]);

end;

end;

相关阅读 >>

Delphi 多桌面切换

Delphi 隐藏任务栏程序,取消自动对齐和网格对齐

Delphi 简单得多线程应用

Delphi xe5的新功能“ tlistview内置搜索过滤”

Delphi 资源文件管理 resources and images

Delphi idftp

Delphi assignfile 与指定的文件建立连接

Delphi中调用http xml

Delphi通过post传递参数给php

Delphi删除文件和文件夹

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...