To Jao:
不好意思,replace是我工具库中的另外一个函数,我忘了他不是DELPHI的标准
函数。
replace函数的代码和说明如下:
function replace( const s,orgSubStr,destSubStr: String
var startIndex: integer ): String;
Replace an orgSubStr to destSubStr in String s from StartIndex,
new Index is return by StartIndex, when Replace is take, StartIndex is length( s ) + 1
new String is Returned by Return Value
function replace( const s,orgSubStr,destSubStr: String
var startIndex: integer ): String;
var
subPositon: integer;
begin
result := s;
subPositon := Pos( orgSubStr,result );
if subPositon <> 0 then
begin
delete( result,subPositon,length( orgSubStr ) );
insert( destSubStr,result,subPositon );
Inc( startIndex,length(destsubStr ) );
end
else
startIndex := length( s ) + 1;
end;