string. gsub
functionimplementedavailable in: camelot
Substitutes text matching a pattern with a replacement. = gsub = s:gsub
The client has this function, but Blizzard's documentation leaves it out, so its parameters and results aren't known.
Parameters
| name | type | description |
|---|---|---|
s | string | String to search. |
pattern | string | Pattern matching expression, covered in HOWTO: Use Pattern Matching or the Patterns Tutorial on Lua-Users.org. |
replace | string | function | table | Replacement text, or a function which may return replacement text, or a lookup table which may contain replacements (see details). |
n | number? | The maximum number of substitutions (unlimited if omitted). |
Returns
| # | name | type | description |
|---|---|---|---|
| 1 | text | string | Resulting string after any substitutions. |
| 2 | count | number | Number of times the pattern was matched; including when no suitable replacement was found (applicable when replace is a function or table). |
In wowlua's emulated client
implementedwowlua models the system behind it. what the statuses mean
sources
Description: warcraft.wiki.gg's API pages ↗, by its contributors, CC BY-SA 4.0 ↗.