--[[ This module is intended to provide access to basic string functions. Most of the functions provided here can be invoked with named parameters, unnamed...
replace operations on strings. local p = {} -- Takes one string parameter, and returns the string with all characters with special meaning for Lua patterns...
cladeString = cladeString .. '\n|-' cladeString = cladeString .. barLabelCellString cladeString = cladeString .. leafCellString cladeString...
args[1]) end function p._main (searchString) local content = mw.title.getCurrentTitle():getContent() local offset = string.find(content, "==", 1 , true) ...
tostring(number_string) elseif type(number_string) ~= 'string' or not number_string:find('%S') then -- We were passed a non-string or a blank string, so exit...
-- loop through all of the bytes and calculate the checksum if v == string.byte( "X" ) then-- if checkdigit is X (compares the byte value of 'X'...
Example: {{sort|{{dts|2013|07|07}}|{{dts|1990|12|01}}}} if string.find(sortkey, "sortkey") or string.find(sortkey, "data-sort-value") then return ""; end...
= string.gsub(mw.text.trim(name), "", italMarker) name = string.gsub(string.gsub(name, "×", "×"), "×", "×") name = string.gsub(name...
return nil end if sort then cat = string.format('[[Category:%s|%s]]', cat, sort) else cat = string.format('[[Category:%s]]', cat) end self...
list items into one string -- Parameter: -- args -- table (sequence) with numKey=string -- apply -- string (optional); separator...
end local function quote(value) if type(value) == 'string' then return (string.gsub(string.format('%q', value), '\\\n', '\\n')) -- Outer parentheses...
plural. local stringToFormat if #links > 1 then stringToFormat = 'The main %ss for this [[Help:Categories|category]] are %s.' else stringToFormat =...
type(section) == 'string' then section = string.gsub(section, "{", "{") section = string.gsub(section, "}", "}") end return string.format('[[%s#%s|%s]]'...
(disambiguation)". checkType('disambiguate', 1, page, 'string') checkType('disambiguate', 2, disambiguator, 'string', true) disambiguator = disambiguator or 'disambiguation'...
-- String replacement that ignores part of the string in "..." local function strReplace(String, old, new) if String:find('"') then local...
part of date string. Usage: {{#invoke:ISOdate|ISOyear|target_string}} Parameters 1: The date string Error Handling: If the string does not look...
starts if string.match(index, '%A') then return '1' end return string.upper(index) end local function stripToNil(text) -- If text is a string, return...
"") end p.sentence = function (frame) -- {{lc:}} is strip-marker safe, string.lower is not. frame.args[1] = frame:callParserFunction('lc', frame.args[1])...
parameter names (unnumbered versions only) -- Specify each as either a single string, or a table of strings (aliases) -- Aliases are checked left-to-right...
sectionString = 'section' } for k, v in pairs(defaultOptions) do if options[k] == nil then options[k] = v end end -- Set initial "about" string local...