S sevenqitao Unregistered / Unconfirmed GUEST, unregistred user! 2007-12-09 #1 在fileopen下第一步是找到a的位置,使用什么函数? 第二步是将b代替a,又用什么函数? 谢谢:) 给个想法也好
S sunboy_del Unregistered / Unconfirmed GUEST, unregistred user! 2007-12-09 #2 自己写啊,没有现成的吧:) function ReplaceStr(Str, SearchStr, ReplaceStr: string): string; begin while Pos(SearchStr, Str) <> 0 do begin Insert(ReplaceStr, Str, Pos(SearchStr, Str)); Delete(Str, Pos(SearchStr, Str), Length(SearchStr)); end; Result := Str; end;
自己写啊,没有现成的吧:) function ReplaceStr(Str, SearchStr, ReplaceStr: string): string; begin while Pos(SearchStr, Str) <> 0 do begin Insert(ReplaceStr, Str, Pos(SearchStr, Str)); Delete(Str, Pos(SearchStr, Str), Length(SearchStr)); end; Result := Str; end;
O onyliu Unregistered / Unconfirmed GUEST, unregistred user! 2007-12-10 #4 有自带的函数啊 replacestring (也许是stringreplace 记不清楚了 :))