多 多多帮助 Unregistered / Unconfirmed GUEST, unregistred user! 2008-05-23 #1 有TStringList值为 1,好 2,好 3,好 1,好 怎么迅速找到3.好后把他再改成3,不好 要速度快的。
F FlyDayDream Unregistered / Unconfirmed GUEST, unregistred user! 2008-05-23 #4 procedure TForm1.Button1Click(Sender: TObject); var s:Tstrings; i:integer; begin s:=tstringlist.Create; try s.add('a,no'); s.add('b,no'); i:=s.IndexOf('a,no'); if i<0 then Exit; showmessage(s.Strings); s.Strings[s.IndexOf('a,no')]:='a,yes'; showmessage(s.Strings); finally s.free; en;d end;
procedure TForm1.Button1Click(Sender: TObject); var s:Tstrings; i:integer; begin s:=tstringlist.Create; try s.add('a,no'); s.add('b,no'); i:=s.IndexOf('a,no'); if i<0 then Exit; showmessage(s.Strings); s.Strings[s.IndexOf('a,no')]:='a,yes'; showmessage(s.Strings); finally s.free; en;d end;