处理对象:"200个",截取结果"个"
处理对象:"200kg",截取结果"kg"
function TFmxsdd_dzbh.getTheUnit(str:string):string;
var
n,i :integer;
ch: byte;
s:string;
begin
s:='';
n:=length(str);
i:=1;
while i<=n do
begin
if not (str[i] in ['0'..'9']) then
begin
ch := Byte(str[i]);
if Windows.IsDBCSLeadByte(ch) then
begin
s:= s+ Copy(str, i, 2);
i:=i+1;
end
else
s:= s + str[i];
end;
i:=i+1;
end;
Result:=s;
end;