Garry's Mod Wiki

Garry's Mod Wiki

  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
The processed string with replacements.

Example

Replaces the word "Garrys" with "Hers".

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

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...