如何区分数字与字母
判断输入的是字母还是数字 请问这个判断语句该怎么写呀??
function CheckString(S: string): Boolean;
var
vStr: string;
vChar: string;
begin
result := True;
vStr :=S;
while vStr <> '' do
begin
vChar :=copy(vStr,0,1);
vStr := copy(vStr, 2, length(vStr) - 1);
if not (((vChar>='a') and (vChar<='z')) or ((vChar>='A') and (vChar<='Z'))) then
begin
result := False;
break;
end;
end;
end;
function Checknum(S: string): Boolean;
var
vStr: string;
vChar: string;
begin
result := True;
vStr := S;
while vStr <> '' do
begin
vChar := copy(vStr, 0, 1);
vStr := copy(vStr, 2, length(vStr) - 1);
try
StrToInt(vChar);
except
result := False;
break;
end;
end;
end;