Garry's Mod Wiki

string.Replace

string string.Replace( string str, string find, string replace )

Description

Replaces all occurrences of the supplied second string.

Arguments

1 string str
The string we are seeking to replace an occurrence(s).
2 string find
What we are seeking to replace.
3 string replace
What to replace find with.

Returns

1 string
string

Example

Replaces the word "Garrys" by "Hers".

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

Page Links


Special Pages


Wikis

?

Render Time: 94ms

DB GetPage 43
Generate Html 8
SaveChanges (1) 21
Render Body 0
Render Sidebar 18