Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

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

AW: how to use the option flag rfReplaceAll in ReplaceStr

  Alt 25. Jun 2020, 19: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]);
$2B or not $2B

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