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

Module:StringReplace

கட்டற்ற கலைக்களஞ்சியமான விக்கிப்பீடியாவில் இருந்து.
Inkbug (பேச்சு | பங்களிப்புகள்) பயனரால் செய்யப்பட்ட 13:15, 24 பெப்ரவரி 2013 அன்றிருந்தவாரான திருத்தம் (Created page with 'local p = {} function escapePattern(text) return string.gsub(text, "[%(%)%.%%%+%-%*%?%[%^%$]", "%%%1") end function p.replace_all(frame) local str = fram...')

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

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