replace_string

Синтаксис

native replace_string(text[], maxlength, const search[], const replace[], bool:caseSensitive = true);

Употреба

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

Описание

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

Забележка

Similar to replace_all() stock, but implemented as native and
with different algorithm. This native doesn't error on bad
buffer size and will smartly cut off the string in a way
that pushes old data out.

Забележка

Only available in 1.8.3 and above.

Забележка

This supports multi-byte characters (UTF-8) on case insensitive comparison.

Връщаща стойност

Number of replacements that were performed.