function GetNumFromStr(const str: String;const hex:boolean=false): String;
var
 i:integer;
 charset:Set of char;
begin
if hex then
 charset:=['0'..'9','a'..'f','A'..'F','.']
else
 charset:=['0'..'9','.'];
for i := 1 to Length(str) do
  begin
    if (str[i] in charset) then
      result:= result + uppercase(str[i]);
  end;
end;

可以取得十六进制的数字!可以包含小数点,但你必须保证只有一个小数点!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2021-06-09
猜你喜欢
  • 2022-12-23
  • 2021-12-01
  • 2021-12-22
  • 2021-12-22
相关资源
相似解决方案