string.Replace

From Garry's Mod
Jump to: navigation, search
 string.Replace( )

Contents

Description

Replaces all occurrences of the supplied second string.

Arguments

string str

The string we are seeking to replace an occurrence(s).

Arguments

string find

What we are seeking to replace.

Arguments

string replace

What to replace find with.

Returns

string

string

Examples

Example

Replaces the word "Garrys" by "Hers".

local text = "Garrys Mod"
print(string.Replace(text, "Garrys", "Hers"))

Output:


Hers Mod
Personal tools
Navigation