v0.13.8

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

nametypedescription
sstringString to search.
patternstringPattern matching expression, covered in HOWTO: Use Pattern Matching or the Patterns Tutorial on Lua-Users.org.
replacestring | function | tableReplacement text, or a function which may return replacement text, or a lookup table which may contain replacements (see details).
nnumber?The maximum number of substitutions (unlimited if omitted).

Returns

#nametypedescription
1textstringResulting string after any substitutions.
2countnumberNumber 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 ↗.