Content


NTL
Core
Replace

Replace



Replace first occurrence of substring in specified string with specified value.

You can find more information in comments below.

/**
Replace first occurrence of substring "search" in string "str" on substring "replace" and return new string 
@param str String where to search 
@param search Searching string 
@param replace String to replace with 
@return String where first occurrence of "search" is replaced with "replace" 
*/
String Replace(const String &str, const String &search, const String &replace);
/**
Replace first occurrence of substring "search" in ANSI string "str" on substring "replace" and return new ANSI string 
@param str String where to search 
@param search Searching string 
@param replace String to replace with 
@return String where first occurrence of "search" is replaced with "replace" 
*/
AnsiString Replace(const AnsiString &str, const AnsiString &search, const AnsiString &replace);
/**
Replace first occurrence of substring "pair.first" in string "str" on substring "pair.second" and return new string 
@param str String where to search 
@param pair Search and replace parts 
@return String where first occurrence of "pair.first" is replaced with "pair.second" 
*/
String Replace(const String &str, const StringKeyValue &pair);
/**
Replace first occurrence of substring "pair.first" in ANSI string "str" on substring "pair.second" and return new ANSI string 
@param str String where to search 
@param pair Search and replace parts 
@return String where first occurrence of "pair.first" is replaced with "pair.second" 
*/
AnsiString Replace(const AnsiString &str, const AnsiStringKeyValue &pair);
Namespace: nitisa
Include: Nitisa/Core/Strings.h