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;

 

相关文章:

  • 2021-12-22
  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
  • 2022-03-11
  • 2022-12-23
  • 2022-12-23
  • 2021-07-04
相关资源
相似解决方案