Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function ReplaceLinguistic(const OldPattern, NewPattern: string; const ReplaceFlags: TReplaceFlags): Substring; overload; | Replaces OldPattern by NewPattern, found by the rules of the default locale or of LocaleID: the first occurrence, or every occurrence with rfReplaceAll; rfIgnoreCase ignores case. |
| 2 | function ReplaceLinguistic(const OldPattern, NewPattern: string; const ReplaceFlags: TReplaceFlags; const LocaleID: TLocaleID): Substring; overload; |
Overload 1: function ReplaceLinguistic(const OldPattern, NewPattern: string; const ReplaceFlags: TReplaceFlags): Substring; overload;
Replaces OldPattern by NewPattern, found by the rules of the default locale or of LocaleID: the first occurrence, or every occurrence with rfReplaceAll; rfIgnoreCase ignores case.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | OldPattern | string | |
| 2 | NewPattern | string | |
| 3 | ReplaceFlags | TReplaceFlags |
Returns: Substring - The new value.
Remarks:
Every text kind for both patterns. A match may be longer or shorter than OldPattern; a pattern of only ignorable characters is never found. Note: This routine is 6.4 to 53 times slower than ReplaceAscii, and 6.7 to 85 times slower than Replace, due to handling of the locale specific char handling. Use ReplaceAscii or Replace, if this handling is not needed.
Examples
The soft hyphen inside the match is replaced with it.
uses Substr;
procedure Example;
begin
Assert(Substring('ca'#$AD'f'#$E9).ReplaceLinguistic('caf'#$E9, 'tea', []) = 'tea');
end;
See Also: Substring.ReplaceAscii, Substring.ReplaceInvariant
Overload 2: function ReplaceLinguistic(const OldPattern, NewPattern: string; const ReplaceFlags: TReplaceFlags; const LocaleID: TLocaleID): Substring; overload;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | OldPattern | string | |
| 2 | NewPattern | string | |
| 3 | ReplaceFlags | TReplaceFlags | |
| 4 | LocaleID | TLocaleID |
Returns: Substring