ReplaceString

Last Updated2021-06-24
Created At2007-05-22

Given a string, replaces all occurrences of a search string with a replacement string.

native int ReplaceString(char[] text, int maxlength, const char[] search, const char[] replace, bool caseSensitive = true)

Parameters

char[] text
String to perform search and replacements on.
int maxlength
Maximum length of the string buffer.
const char[] search
String to search for.
const char[] replace
String to replace the search string with.
bool caseSensitive
If true (default), search is case sensitive.

Return Value

int Number of replacements that were performed.

Error

'search' parameter is empty.