System.WideStrUtils.WideReplaceStr

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function WideReplaceStr(const AText, AFromText, AToText: WideString): WideString;

C++

extern DELPHI_PACKAGE System::WideString __fastcall WideReplaceStr(const System::WideString AText, const System::WideString AFromText, const System::WideString AToText);

Properties

Type Visibility Source Unit Parent
function public
System.WideStrUtils.pas
System.WideStrUtils.hpp
System.WideStrUtils System.WideStrUtils

Description

Replaces all occurrences of a substring within a string, using case-sensitive search.

Use WideReplaceStr to replace all occurrences of the substring AFromText with the string AToText, within the string AText. WideReplaceStr returns the string obtained after replacement.

Use WideReplaceText to do a case-insensitive replacement.

Note: This function is designed for WideString variables. To work with AnsiString variables, use the System.AnsiStrings.StringReplace function. To work with UnicodeString variables, use the System.SysUtils.StringReplace function.

Note: Recursive replacement of substrings is not supported. This means that if the substitution of AToText results in a new match for AFromText, that match is not replaced.

The WideStringReplace function is a more general replacement routine, giving case-sensitivity options, as well as the option to decide whether to replace all occurrences or the first occurrence of the substring in the string.

See Also