您的位置:首页 > 其它

把不是空格的字符串进行替换

2009-12-11 05:05 260 查看
代码

1 unit Unit1;
2
3 interface
4
5 uses
6 Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
7 StdCtrls;
8
9 type
10 TForm1 = class(TForm)
11 Button1: TButton;
12 procedure Button1Click(Sender: TObject);
13 private
14 { Private declarations }
15 public
16 { Public declarations }
17 end;
18
19 var
20 Form1: TForm1;
21
22 implementation
23
24 {$R *.DFM}
25
26 procedure TForm1.Button1Click(Sender: TObject);
27 var
28 s:string;
29 i:integer;
30 begin
31 i:=1;
32 s:='123abc';
33 while(i<=length(s))and(s[i]<>'')do
34 begin
35 s[i]:='f';
36 inc(i);
37 showmessage(inttostr(i));
38 showmessage(s);
39 end;
40 end;
41 end.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: