delphi字符串中取数字
作者:互联网
function TForm1.getNumberFromStr(strIn: string; sFlag: string): string; var i: Integer; tempStr: string; begin tempStr := ''; if Length(strIn) = 0 then begin Result := ''; exit; end; for i := 1 to strIn.Length do begin if strIn[i] = sFlag then //截取到sFlag位置结束 Break; if IsNumber(strIn[i]) then //isNumber--System.Character begin tempStr := tempStr + strIn[i]; end; end; Result := tempStr; end;
标签:begin,end,string,strIn,delphi,中取,tempStr,字符串,sFlag 来源: https://www.cnblogs.com/yangxuming/p/10967969.html