function removeLeadingZeros(const Value: string): string;
var
i: Integer;
begin
for i := 1 to Length(Value) do
if Value[i]<>'0' then
begin
Result := copy(Value,i,MaxInt);
exit;
end;
Result := '';
end;
根据具体要求,您可能希望修剪空白.我没有这样做,因为这个问题没有提到.
更新
我修复了Serg在原始版本中确定的错误.