S sgxz2000 Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-11 #1 请问如何在一个串中删除一个子串?例如在串ssddssas中删除子串dd!
S sgxz2000 Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-11 #2 请问如何在一个串中删除一个子串?例如在串ssddssas中删除子串dd!
H hongxing_dl Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-11 #3 var s:string; subs:string; begin s:='ssddssas'; subs:='dd'; s:=stringreplace(s,subs,'',[rfReplaceAll]);//你如只删除第一个匹配的子串,那么改最后那个参数就可以了 end;
var s:string; subs:string; begin s:='ssddssas'; subs:='dd'; s:=stringreplace(s,subs,'',[rfReplaceAll]);//你如只删除第一个匹配的子串,那么改最后那个参数就可以了 end;
X xianguo Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-11 #4 Edit1.Text := StringReplace('ssddssas', 'dd', '', [rfReplaceAll]);
O oiwin Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-11 #5 var s:string; subs:string; begin s:='ssddssas'; subs:='dd'; Delete(s,pos(subs,s),Length(subs)); Edit1.Text:=s;
var s:string; subs:string; begin s:='ssddssas'; subs:='dd'; Delete(s,pos(subs,s),Length(subs)); Edit1.Text:=s;
D delphibbs99999 Unregistered / Unconfirmed GUEST, unregistred user! 2005-04-12 #7 就是,使用delete函数,如果是插入的话用insert。在delphi的帮助中,可以找到这两个函数的具体表述。我刚刚写了个程序,就是用insert转换的。