Anonymous

Module:Shared: Difference between revisions

From Melvor Idle
no edit summary
mNo edit summary
No edit summary
Line 460: Line 460:


function p._replace(str, searchTerm, replacementTerm)
function p._replace(str, searchTerm, replacementTerm)
if str == nil then
return nil
end
     local escapedSearch = searchTerm:gsub("[%^%$%(%)%%%.%[%]%*%+%-%?]", "%%%1")
     local escapedSearch = searchTerm:gsub("[%^%$%(%)%%%.%[%]%*%+%-%?]", "%%%1")
     local result = str:gsub(escapedSearch, replacementTerm)
     local result = str:gsub(escapedSearch, replacementTerm)
2,875

edits