Module:Casefold

--- Functions for doing case-insensitive comparisons --

local p = {}

--- Return whether a string is in an array of strings. -- Comparisons are not case-sensitive. -- @param {string} str String to check. -- @param {table} set Array of strings. -- @return {bool} Whether str is in set. function p.matches_in(str, set) local lang = mw.getContentLanguage str = lang:caseFold(str) for _, element in pairs(set) do   if str == lang:caseFold(element) then return true end end return false end

return p