procedure TForm1.Button1Click(Sender: TObject);
var s:AnsiString;
i:Integer;
IsNumber:boolean;
begin
s:=Edit1.Text;
if StrToIntDef(S, 0) = StrToIntDef(S, 1) then
ShowMessage(S+' 是整数字符串 ');
IsNumber := Length(S) > 0;
for I := 1 to Length(S) do
begin
if not (S[I] in['0'..'9','[',']') then
begin
IsNumber := False;
Break;
end;
end;
if Length(S) div 2 = Length(WideString(S)) then
ShowMessage(S+' 是汉字符串 ');
end;
end.