{Alternative à la fonction de Japee ... jusqu'à deux fois plus rapide}
Uses StrUtils; {Indispensable pour PosEx}
Function ReplaceMidStr(Const S, SLeft, SRight, NewStr: String): String;
Var
PosLeft, PosRight: Integer;
Begin
PosLeft := Pos(SLeft, S);
If PosLeft < 1 Then Exit;
Inc(PosLeft, Length(SLeft));
PosRight := PosEx(SRight, S, PosLeft);
If PosRight < 1 Then Exit;
Result := Copy(S, 1, PosLeft-1) + NewStr + Copy(S, PosRight, High(Integer));
End;