1,014
edits
(Add function for sorting dictionaries) |
(Issue finally found...) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 457: | Line 457: | ||
return left == right | return left == right | ||
end | end | ||
end | |||
function p._replace(str, searchTerm, replacementTerm) | |||
if str == nil then | |||
return str | |||
end | |||
local escapedSearch = searchTerm:gsub("[%^%$%(%)%%%.%[%]%*%+%-%?]", "%%%1") | |||
local result = str:gsub(escapedSearch, replacementTerm) | |||
return result | |||
end | |||
function p.replace(frame) | |||
local args = frame:getParent().args | |||
return p._replace( | |||
frame.args[1], | |||
frame.args[2] or '', | |||
frame.args[3] or '') | |||
end | end | ||
return p | return p |
edits