Logo

Programming-Idioms

History of Idiom 63 > diff from v29 to v30

Edit summary for version 30 by :
New Lua implementation by user [Nepta]

Version 29

2016-02-22, 14:31:18

Version 30

2016-04-08, 13:17:28

Idiom #63 Replace fragment of a string

Assign to x2 the value of string x with all occurrences of y replaced by z.
Assume occurrences of y are not overlapping.

Idiom #63 Replace fragment of a string

Assign to x2 the value of string x with all occurrences of y replaced by z.
Assume occurrences of y are not overlapping.

Code
x2 = x:gsub(y,z)
Doc URL
http://www.lua.org/manual/5.3/manual.html#pdf-string.gsub
Demo URL
http://codepad.org/oxQGXyZV