const
S = '我ABCDEFG我ABCDEFGHIJK';
var
WC: array[0..10] of WideChar;
I: Integer;
begin
for I := 0 to 10 do
begin
WC := WideChar(S[I + 1]); //这样的话,'我'字就会被分成两部分
WC := WideString(S)[I + 1]; //这样能正确识别'我'字
end;
end;
当然,用WideString就更好了
const
S: WideString = '我ABCDEFG我ABCDEFGHIJK';
var
WC: array[0..10] of WideChar;
I: Integer;
begin
for I := 0 to 10 do
WC := S[I + 1];
end;