உள்ளடக்கத்துக்குச் செல்

Module:StringReplace

கட்டற்ற கலைக்களஞ்சியமான விக்கிப்பீடியாவில் இருந்து.

Documentation for this module may be created at Module:StringReplace/doc

local p = {}
function p.escape_pattern(text)
    local r = string.gsub(text, "[%(%)%.%%%+%-%*%?%[%^%$]", "%%%1")
    return r
end
function p.replace_all(frame)
    local str = frame.args[1]
    local strToFind = frame.args[2]
    local strToreplaceWith = frame.args[3]
    local r = string.gsub(str, p.escape_pattern(strToFind), p.escape_pattern(strToreplaceWith))
    return r
end
return p
"https://ta.wikipedia.org/w/index.php?title=Module:StringReplace&oldid=2030668" இலிருந்து மீள்விக்கப்பட்டது