Unit 'StrUtils' Package
[Overview][Resource strings][Constants][Types][Procedures and functions][Index] [#rtl]

StringsReplace

Replace occurrences of a set of strings to another set of strings.

Declaration

Source position: strutils.pp line 128

function StringsReplace(

  const S: Ansistring;

  OldPattern: array of Ansistring;

  NewPattern: array of Ansistring;

  Flags: TReplaceFlags

):string;

Description

StringsReplace scans S for the occurrence of one of the strings in OldPattern and replaces it with the corresponding string in NewPattern. It takes into account Flags, which has the same meaning as in StringReplace.

Corresponding strings are matched by location: the N-th string in OldPattern is replaced by the N-th string in NewPattern. Note that this means that the number of strings in both arrays must be the same.

Errors

If the number of strings in both arrays is different, then an exception is raised.

See also

StringReplace

  

Replace occurrences of one substring with another in a string.

TReplaceFlags

  

Flags for StringReplace function.


Documentation generated on: Jul 22 2023