请问如何去掉一个字符串的前导0

fht 2001-02-27 12:50:00
一个字符串'0000000123456'如何将它变为‘123456’
...全文
621 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
王集鹄 2001-02-27
  • 打赏
  • 举报
回复
procedure TForm1.Button1Click(Sender: TObject);
begin
Edit1.Text := DelTop0(Edit2.Text);
end;
lldwolf 2001-02-27
  • 打赏
  • 举报
回复
var
source:string;
object:string;
begin
source:='000000123456';
object:=inttostr(strtoint(source))
end;
王集鹄 2001-02-27
  • 打赏
  • 举报
回复
function DelTop0(mStr: string): string;
begin
Result := mStr;
while Copy(Result, 1, 1) ='0' do Delete(Result, 1, 1);
end;

5,379

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧