Anonymous

Module:Shared: Difference between revisions

From Melvor Idle
m
Add string compare method
(Fix name clash between parameters and module name)
m (Add string compare method)
Line 413: Line 413:
end
end
return namespace, localID
return namespace, localID
end
-- Compares two strings, optionally ignoring case
function p.compareString(left, right, ignoreCase)
-- Both are nil (equal)
if left == nil and right == nil then return true end
-- Only one is nil (not equal)
if left == nil or right == nil then return false end
if ignoreCase == true then
return left:upper() == right:upper()
else
return left == right
end
end
end


return p
return p
2,875

edits