J jianguo_bu Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-24 #1 我想判断字符变量a是否在-,1,2,3,4,5,6,7,8,9之内,请问该怎么写?
A apzhang Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-24 #2 var c : char; begin .... if c in ['-','1','2','3','4','5','6','7','8','9'] then ..... end;
扳 扳手 Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-24 #4 function aa(a:string):boolean; const bzh:array[1..10] of string=('-','1','2','3','4','5','6','7','8','9'); var i:integer; begin for i:=1 to 10 do begin if a=bzh then begin result:=true; exit; end end; result:=false; end;
function aa(a:string):boolean; const bzh:array[1..10] of string=('-','1','2','3','4','5','6','7','8','9'); var i:integer; begin for i:=1 to 10 do begin if a=bzh then begin result:=true; exit; end end; result:=false; end;
L LeeChange Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-24 #5 if (a in ['1'..'9', '-']) then
刘 刘李子 Unregistered / Unconfirmed GUEST, unregistred user! 2002-07-24 #8 function CharInSet( c:Char):Boolean; const CHARS = '-123456789'; begin Result:=StrScan( CHARS,c ) <> nil; end;
function CharInSet( c:Char):Boolean; const CHARS = '-123456789'; begin Result:=StrScan( CHARS,c ) <> nil; end;
J jianguobu Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-04 #10 if a in ['-','1','2','3','4','5','6','7','8','9'] then