str_replace
Replaces occurrences of pattern with replacement. Use 0 for all occurrences, or specify count.
str_replace(
str,
pattern,
replacement,
[count=0]
) -> STRING
Replaces occurrences of pattern with replacement. Use 0 for all occurrences, or specify count.
Syntaxe
var result = str_replace("Hello World", "o", "*", 0);
Arguments
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
str | yes | - | Source string | |
pattern | yes | - | Substring to find | |
replacement | yes | - | Replacement string | |
count | - | 0 | Number of replacements (0 for all) |