“Delphi -Zeichenfolge Ersetzen” Code-Antworten

Delphi Ersetzen Sie Zeichenfolge

  newString := StringReplace(<currentString>, <stringToReplace>, <newString>,
   [rfReplaceAll, rfIgnoreCase]);
miletoo

Delphi -Zeichenfolge Ersetzen

You have misunderstood the documentation. If the act of replacing an instance of the search string with the replacement happens to create another instance of the search string, it is not searched again. The search continues from the end of the replacement text.

The function searches for all instances of the target string in the input string S. The input string is not modified. To get the output you expected, it would have to search for instances of the target string in the result, not just in the input.

Imagine if the search and replacement strings were identical. The function might never return because each time it found its target and replaced it, it would find yet another copy of the target text.
Santino

Ähnliche Antworten wie “Delphi -Zeichenfolge Ersetzen”

Fragen ähnlich wie “Delphi -Zeichenfolge Ersetzen”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen