Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.153 Beiträge
 
Delphi 12 Athens
 
#4

AW: how to use the option flag rfReplaceAll in ReplaceStr

  Alt 25. Jun 2020, 18:00
Declaring this type is not really right
and it's totally wrong how it was declared. (ENUM <> SET)


ReplaceStr does not have this parameter, because everything is always replaced there and the case sensitivity is controlled by the function name.

Delphi-Quellcode:
// System.StrUtils
S := ReplaceStr(S, Old, New); // same as StringReplace(S, Old, New, [rfReplaceAll])
S := ReplaceText(S, Old, New); // same as StringReplace(S, Old, New, [rfReplaceAll, rfIgnoreCase])

// System.SysUtils
S := StringReplace(S, Old, New, [rfReplaceAll]);

// System.SysUtils : TStringHelper
S := S.Replace(Old, New); // implicit rfReplaceAll
S := S.Replace(Old, New, [rfReplaceAll]);
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests

Geändert von himitsu (25. Jun 2020 um 18:45 Uhr)
  Mit Zitat antworten Zitat