Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
帕斯卡中是否有将字符串的第一个字母转换为大写的语法(如大写字母)。只有第一个字母。
是的; 您可能会使用UpCase函数(希望大多数 Pascal 变体都有它)。下面显示了如何使用它来大写给定S字符串中的第一个字符。
UpCase
S
function UpCaseFirstChar(const S: string): string; begin Result := S; if Length(Result) > 0 then Result[1] := UpCase(Result[1]); end;