string.gsub
string, number string.gsub( string string, string pattern, string replacement, number maxReplaces = nil )
Description
This function's main purpose is to replace certain character sequences in a string using Patterns.
Arguments
3 string replacement
In case of a string, the matched sequence will be replaced with it.
In case of a table, the matched sequence will be used as a key, and the table will be tested for the key. If a value exists, it will be used as the replacement.
In case of a function, all matches will be passed as parameters to the function. The return value(s) of the function will then be used as the replacement.
4 number maxReplaces = nil
Maximum number of replacements to be made. Leave it empty to replace all matches.
Returns
Example
Page views: 52,293
Updated: This Month
Updated: This Month
Garry's Mod
Rust
Steamworks
Wiki Help