{對字符數組}
procedure TForm1.Button3Click(Sender: TObject);
var
Arr: array[0..2+1] of Char;
begin
Arr := 'abc';
CharUpper(Arr);
ShowMessage(Arr); {ABC}
end;
{對字符串}procedure TForm1.Button4Click(Sender: TObject);
var
str: string;
begin
str := 'abc';
CharUpper(@str[1]);
ShowMessage(str); {ABC}
end;
{Delphi 的 System.UpCase 和 SysUtils.LowerCase}
procedure TForm1.Button5Click(Sender: TObject);
var
c: Char;
str: string;
begin
c := 'a';
c := UpCase(c);
str := 'abc';
str := UpperCase(str);
ShowMessageFmt('%s, %s', [c, str]); {A, ABC}
end;