Redirect to:
Implements template {{Str find word}}. This module looks for a word being present in a comma-separated list of words. It then returns a True or False...
Click to read more »require[[strict]] local p = {} function p._rightc(str, count, empty) str = mw.text.trim(str or '') if '' == str then return mw.text.trim(empty or '') end...
Click to read more »implements: {{str rightc}} but if |notemplate= is set to a non-empty string, arguments from the invocation can be used. {{#invoke:str...
Click to read more »function str._getBoolean( boolean_str ) local boolean_value if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower() if boolean_str ==...
Click to read more »function str._getBoolean( boolean_str ) local boolean_value if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower() if boolean_str ==...
Click to read more »require('strict') local p = {} local getArgs = require('Module:Arguments').getArgs local str = require('Module:String') local yesno = require('Module:Yesno') local defaultSep...
Click to read more »local str_i = 1 while fargs['s' .. str_i] do fargsused['s' .. str_i] = true args[str_i] = fargs['s' .. str_i] str_i = str_i + 1 end...
Click to read more »boolean_str ) local boolean_value; if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower(); if boolean_str ==...
Click to read more »removeFalsePositives(str) if not str then return '' end str = mw.ustring.gsub(str, "<!--.--->", "") str = mw.ustring.gsub(str, "<nowiki>.-</nowiki>", "") str = mw...
Click to read more »removeFalsePositives(str) if not str then return '' end str = mw.ustring.gsub(str, "<!--.--->", "") str = mw.ustring.gsub(str, "<nowiki>.-</nowiki>", "") str = mw...
Click to read more »(str) if not is_set (str) then return str end if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end if str:sub (-1, -1) == "'" then str =...
Click to read more »boolean_str ) local boolean_value; if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower(); if boolean_str ==...
Click to read more »'string' then boolean_str = boolean_str:lower() if boolean_str == 'true' or boolean_str == 'yes' or boolean_str == '1' then boolean_value = true...
Click to read more »(str) if not is_set (str) then return str end if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end if str:sub (-1, -1) == "'" then str =...
Click to read more »"(" str = mw.ustring.sub(str,2,mw.ustring.len(str)) elseif mw.ustring.sub(str,1,1) == '"' then isQuoted = true result = '"' str = mw.ustring...
Click to read more »1288834974 local id_str = frame.args.id_str if type(id_str) ~= "string" then error("bad argument #1 (expected string, got " .. type(id_str) .. ")", 2) end...
Click to read more »end function p.is_Latin(str) require "libraryUtil".checkType("get_best_script", 1, str, "string") str = mw.text.decode(str, true) -- Search for the...
Click to read more »local str_i = 1 while fargs['s' .. str_i] do fargsused['s' .. str_i] = true args[str_i] = fargs['s' .. str_i] str_i = str_i + 1 end...
Click to read more »sDecodeTrim( str ) if str == nil then return nil end str = mw.ustring.gsub( strDeEnCode._decode( str ), '%s+' , ' ' ) return mw.text.trim( str ) end --...
Click to read more »"(" str = mw.ustring.sub(str,2,mw.ustring.len(str)) elseif mw.ustring.sub(str,1,1) == '"' then isQuoted = true result = '"' str = mw.ustring...
Click to read more »wikipedia.org/wiki/Mall:KML inline_format = "box", }, -- Other strings str = { inline = "inline", -- used with display parameter: (|display=inline)...
Click to read more »elseif args.title then str = str .. string.format("'''Page''': [[%s]] ", args.title) elseif args.namespace then str = str .. string.format("In namespace:...
Click to read more »1288834974 local id_str = frame.args.id_str if type(id_str) ~= "string" then error("bad argument #1 (expected string, got " .. type(id_str) .. ")", 2) end...
Click to read more »boolean_str ) local boolean_value; if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower(); if boolean_str ==...
Click to read more »has_accept_as_written() if not utilities.is_set (str) then return str; end local accept; -- Boolean str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—']...
Click to read more »self:preprocess_equals('{{#invoke:TwitterSnowflake | snowflakeToDate | id_str = 1345021162959503360}}', 'January 1, 2021') end function...
Click to read more »text for math_str in str:gmatch (pattern) do -- walk through the text and for each $-delimited math text math_str = math_str:gsub (pattern...
Click to read more »tbl_str = mw.text.unstripNoWiki (args[1]); -- undo <nowiki>'s escaping of the wikitext (mw.text.decode (tbl_str); is too aggressive) tbl_str = tbl_str:gsub('<'...
Click to read more »local str = "[[File:Wikipedia-logo-v2.svg|24px]]" return str end p.grin = function(frame) local str = "[[File:Twemoji 1f600.svg|24px]]" return str end...
Click to read more »a_str = a_str:gsub ("+", " ") a_str = a_str:gsub ("%%(%x%x)", function(h) return string.char(tonumber(h,16)) end) a_str = string...
Click to read more »----箭頭的底盤 拿來旋轉方向使用 str = str .. '<div style="z-index:108;position:absolute;' str = str .. 'left:' .. (t[1] - 1) * size .. 'px;' str = str .. 'top:' .. t[2]...
Click to read more »local str = frame.args.input -- nu-n=>n, ku-k=>k if string.len(str) > 3 and string.sub(str, 1, 1) == string.sub(str, 4, 4) then if string.sub(str, 2...
Click to read more »'</span>' end local function is_valid_isxn_13 (isxn_str) local temp=0; isxn_str = { isxn_str:byte(1, 13) }; -- make a table of byte values...
Click to read more »characters. ]] local function is_valid_isxn (isxn_str, len) local temp = 0; isxn_str = { isxn_str:byte(1, len) }; -- make a table of byte values '0'...
Click to read more »return '' end local num_str = tostring(args[1]) local new_str, _ = string.gsub(num_str, '[0-9.]', conversion_table) return new_str end function p.convert(frame)...
Click to read more »removeFalsePositives(str) if not str then return '' end str = mw.ustring.gsub(str, "<!--.--->", "") str = mw.ustring.gsub(str, "<nowiki>.-</nowiki>", "") str = mw...
Click to read more »str=str.."|-\n|"..args[i] if args[i]~=args[i+2] then str=str.."-" if args[i+2] then str=str..args[i+2] end end str=str....
Click to read more »com/a/14899740/1832568 local function unescape(str) str = string.gsub(str, '&#(%d+);', string.char) str = string.gsub(str, '&#x(%d+);', function(n) return string...
Click to read more »"8","9"} local str = "" while not (n == 0) do local m = n % 10 str = digits[m + 1] .. str n = (n - m) / 10 end return str end function p.isPrime(num)...
Click to read more »local p = {} function p.stripspaces(str) return str:gsub("^%s*(.-)%s*$", "%1") -- trim spaces end function p.split(str, sep) -- split string by separator...
Click to read more »function strcmp (str_a, str_b) local function strcmp (frame) local str_a = frame.args[1]; local str_b = frame.args[2]; str_a = str_a:gsub...
Click to read more »str end local function padright(str, ...) str = tostring(str) if 1 > select('#', ...) then return str end local strlen = mw.ustring.len(str) ...
Click to read more »characters. ]] local function is_valid_isxn (isxn_str, len) local temp = 0; isxn_str = { isxn_str:byte(1, len) }; -- make a table of byte values '0'...
Click to read more »User:Aidan9382, et al. local str_find, str_sub, str_match = string.find, string.sub, string.match local str_gsub, str_gmatch, str_rep = string.gsub, string...
Click to read more »ustring.sub(str, 1, 1))) end end function p.inparentheses(str, lang, space) if (not str) or str == '' then return str end str = '(' .. str .. ')' if...
Click to read more »source_str = new_args['source'] or ''; local pattern = new_args['pattern'] or ''; if source_str == '' or pattern == '' then return source_str; end...
Click to read more »License: CC-BY-SA-4.0 local str_find, str_sub, str_match = string.find, string.sub, string.match local str_gsub, str_gmatch, str_rep = string.gsub, string...
Click to read more »true else strOut = strOut .. replaceSpecialChar(chr) end else strOut = strOut .. chr esc = false end end return strOut end local...
Click to read more »for str in string.gmatch(names,"([^"..separator.."]+)") do if str ~= nil and str ~= "" then str = string.gsub(str,"^%s+","") str = string...
Click to read more »wikipedia.org/wiki/Mall:KML inline_format = "box", }, -- Other strings str = { inline = "inline", -- used with display parameter: (|display=inline)...
Click to read more »parameter: |id_str=, which must be the snowflake ID of the tweet. For example, 1345021162959503360. {{#invoke:TwitterSnowflake|snowflakeToDate|id_str=1345021162959503360}}...
Click to read more »local p = {} function p.formatNum(frame) local str = string.sub(frame.args[1], #frame.args[1] - 2, #frame.args[1]) local temp = " " .. string.sub(frame...
Click to read more »require("Module:Arguments"); local function padStart(str, maxLength, fillString) s = "" for i = 0, maxLength - #str, 1 do f = ""; for j = 0, #fill, 1 do ...
Click to read more »module. Counts disjoint matches only. Usage: {{#invoke:String|count|source_str|pattern_string|plain_flag}} OR {{#invoke:String|count|source= source_string...
Click to read more »add_diff_highlighting(str) if mw.ustring.find(str, "%s") then return '<span style="background-color: var(--wikt-palette-red-4, pink);">' .. string.gsub(str, " "...
Click to read more »-- Appends a string function StringBuilder:append(str) if str then self:_addString(str,self._buffer) end return self -- Method chaining...
Click to read more »for str in string.gmatch(names,"([^"..separator.."]+)") do if str ~= nil and str ~= "" then str = string.gsub(str,"^%s+","") str = string...
Click to read more »end function p.is_Latin(str) require "libraryUtil".checkType("get_best_script", 1, str, "string") str = mw.text.decode(str, true) -- Search for the...
Click to read more »tbl_str = mw.text.unstripNoWiki (args[1]); -- undo <nowiki>'s escaping of the wikitext (mw.text.decode (tbl_str); is too aggressive) tbl_str = tbl_str:gsub('<'...
Click to read more »{"ce", "bc", "bce", "ad"} function flUpper (str) local str = str or "" local l_check = string.match(str, "(%a+)") -- To take the first letter-y part...
Click to read more »utilities for Module:US elections imagemap. stripspaces(str) strips spaces from str. split(str, sep) split str into a table of strings at each sep. Unlike many...
Click to read more »has_accept_as_written() if not utilities.is_set (str) then return str; end local accept; -- Boolean str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—']...
Click to read more »function(frame) local str = frame.args.words or "" if (str == "") then out = string.sub(str,1) else local l_check = string.match(str, "(%a+)") -- To take...
Click to read more »local args = {} local str_i = 1 while fargs['s' .. str_i] do args[str_i] = fargs['s' .. str_i] str_i = str_i + 1 end for i, v in...
Click to read more »queryStr = '%?quality=' .. quality .. '%-Class' queryStr = queryStr .. (importance ~= '' and '&' or '') else queryStr = importance...
Click to read more »check_for_invalid_date(str) return mw.ustring.match(str, '^%?') or mw.ustring.match(str, '^%d%d%?') or mw.ustring.match(str, '^[Uu]nk') end local function...
Click to read more »for i = 1, #arg do if str ~= '' then str = str..vep end str = str..varx(arg[i]) end end return str end end --v function p...
Click to read more »check_for_invalid_date(str) return mw.ustring.match(str, '^%?') or mw.ustring.match(str, '^%d%d%?') or mw.ustring.match(str, '^[Uu]nk') end local function...
Click to read more »<isbn_str> else ]] local function _format_isbn (isbn_str, show_err_msg, separator, output_format, template_name) if (not isbn_str) or ('' == isbn_str) then...
Click to read more »str = str:gsub("+", "") str = string.gsub(str, "+", "")...
Click to read more »<isbn_str> else ]] local function _format_isbn (isbn_str, show_err_msg, separator, output_format, template_name) if (not isbn_str) or ('' == isbn_str) then...
Click to read more »str = "" str = str .. (title and title.text or '<span class="error">nil</span>') if exst == 1 then str = str .. " exists and" else str = str ...
Click to read more »input end end local function doProcessing(str) str = str:sub(3, -3) local testity local j = str:gsub("%{%b{}%}", recurseInner):match("#invoke:"...
Click to read more »safe_for_italics( str ) if not is_set(str) then return str; else if str:sub(1,1) == "'" then str = "<span></span>" .. str; end if str:sub(-1,-1) ==...
Click to read more »wikipedia.org/wiki/Mall:KML inline_format = "box", }, -- Other strings str = { inline = "inline", -- used with display parameter: (|display=inline)...
Click to read more »d_in_m then return 1 end end function p.era_try( str, ptn, idx ) for i = 1, #eras do values = {str:match(ptn .. " (" .. eras[i] .. ")")} for j...
Click to read more »optional decimal) local minStr, maxStr = rangeStr:match('^(%d+%.%d+)%-(%d+%.%d+)$') if not minStr or not maxStr then return DEFAULT_FT_MIN...
Click to read more »local str = frame.args[1] or "" -- first clean up the name str = mw.ustring.gsub(str, "%s+", " ") str = mw.ustring.gsub(str, "'''", "") str =...
Click to read more »local str = txt if (ttlobj.exists) then str = str .. " exists" else str = str .. " does not exist" end if (ttlobj.isRedirect) then str = str .. " and...
Click to read more »= {} function split(str, pat) local t = {n=0} local fpat = "(.-)" .. pat local last_end = 1 local s, e, cap = str:find(fpat, 1) while...
Click to read more »-)==' for str in gmatch(fd, re) do if find(str, '^%s*Enforcement') then --ignore else if find(str, '^=') then s = trim(sub(str, 2)) table...
Click to read more »local str = {} --------------------------------------------------- -- Function: echo -- -- This function returns the contents of the target string...
Click to read more »{} local output_mt = {} function output_mt:insert(str) self.n = self.n + 1 self[self.n] = str end -- also in [[Module:Unicode data/documentation...
Click to read more »function p.ia_url_encode(str) if (str) then str = mw.ustring.gsub (str, "\n", "\r\n") str = mw.ustring.gsub (str, "([^%w %-%_%.%~])", ...
Click to read more »'string' then boolean_str = boolean_str:lower() if boolean_str == 'true' or boolean_str == 'yes' or boolean_str == '1' then boolean_value = true...
Click to read more »Used in User:SeaDragon1/sandbox/Drafts/Templates/Str pad. Scope: local. Parameters: str, maxLength, fillString. Returns: String. Description: Emulates...
Click to read more »main(frame) local str = frame.args[1] -- "2023" → "1 January 2023" if string.match(str, '^%d%d%d%d$') then return '1 January ' .. str; -- "March 2023"...
Click to read more »then str = str .. " It is warm." elseif cels < 9 then str = str .. " It is cold." else str = str .. " It isn't neither warm nor cold." end return str end...
Click to read more »null" end local num_str = tostring(args[1]) local new_str = string.gsub(num_str, "[0-9.]", CONVERSION_TABLE) return new_str end function p.convert(frame)...
Click to read more »for i=1,count do str = str .. "!" .. args[i] if i~=count then str = str .. "!" end end str = str .. "\n|}" return str end function p.main(frame)...
Click to read more »function p.main(frame) local str = getArgs(frame)[1] return p._main(str) end function p._main(str) if (Date(str) == nil) then return 'Invalid'...
Click to read more »the delimiter for pattern matching local function escapePattern(str) return str:gsub("([%^%$%(%)%%%.%[%]%*%+%?%-])", "%%%1") end -- Main function...
Click to read more »looksLikeYear(str) local success, result = pcall(lang.formatDate, lang, 'Y', '1-1-' .. str) return success and tonumber(result) == tonumber(str) end function...
Click to read more »"x", "y", "z", " ", } local str = "" for i = 0, 1000 do str = str .. letters[math.random(#letters)] end return str end return p...
Click to read more »or '2a', ' ', '_') end str = '[' .. url .. ' ' .. tractate .. ' ' .. ( daf or '' ) .. ']' if not nobook then str = '[[Talmud]], <abbr title="'...
Click to read more »str = table.concat(parts) -- 清理多餘零 str = mw.ustring.gsub(str,"零+","零") str = mw.ustring.gsub(str,"零$","") -- 特殊處理十位 10-19 str =...
Click to read more »gsub end local str = tostring(value) if type(value) == 'table' and str ~= 'table' then return '{' .. str .. '}' end return str end local function...
Click to read more »function p._main(sz) local str = "" local i = 0 for i=32,sz,1 do str = str .. mw.ustring.char(i) end return str end function p.char(frame)...
Click to read more »<str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else with allow_empty = false, <str>...
Click to read more »function p.ia_url_encode(str) if (str) then str = mw.ustring.gsub (str, "\n", "\r\n") str = mw.ustring.gsub (str, "([^%w %-%_%.%~])", ...
Click to read more »= {} local function advance_pos_if_starts_with(str, pattern, pos) local i, j = mw.ustring.find(str, pattern, pos) if i == pos and j >= i then return...
Click to read more »hyphenated version str = str:gsub ('(%a)url', '%1-url'); -- archive, dead, chapter, etc urls to hyphenated versions str = str:gsub ('|[%a%-]+=...
Click to read more »true else strOut = strOut .. replaceSpecialChar(chr) end else strOut = strOut .. chr esc = false end end return strOut end local...
Click to read more »local function str_split(inputstr, sep) local t = {} for str in string.gmatch(inputstr, "([^"..sep.."]+)") do table.insert(t, str) end ...
Click to read more »nowiki) and '</nowiki>' or '' local actual_str = val_to_str(actual) local expected_str = val_to_str(expected) local differs_at = self.differs_at...
Click to read more »escape(str) return str:gsub("[|\\]", function (c) return string.format("\\%03d", c:byte()) end) end local function unescape(str) return str:gsub("\\(%d%d%d)"...
Click to read more »local val, str, precision if type(v) == 'string' then if v == 'trace' then val, str, precision = 0, 'trace', 0 else val, str = math_mod...
Click to read more »closest match local str = frame.args[1] local res = '' local isfirst = true for i = 1,#str do local c = str:sub(i,i) -- get i-th...
Click to read more »"my_object". local str = "Hello World!" --Declare a local variable and set it equal to mw.log(str) return str --This tells us to quit...
Click to read more »local function replace_all_but_last(str, pattern, replacement) local last_occurrence_start, last_occurrence_end = str:find(pattern, 1, true) -- Find the...
Click to read more »local val, str, precision if type(v) == 'string' then if v == 'trace' then val, str, precision = 0, 'trace', 0 else val, str = math_mod...
Click to read more »string | returns integer of month OR nil function parseMonth(str) str = string.lower(str) local months = {{"January","jan"}, {"February","feb"}...
Click to read more »string.match(str, "<font[^>]+>%[http[^%] ]+]<%/font>") or string.match(str, "<font[^>]+>%[\{\{fullurl[^%] ]+]<%/font>") then return str; --solo link...
Click to read more »s:match '^%s*(.*)' end local function split_with_comma(str) local fields = {} for field in str:gmatch('([^,]+)') do fields[#fields + 1] =...
Click to read more »function trim(str) --Trims strings, passes through non-strings without modification return (type(str) == 'string') and mw.text.trim(str) or str end local...
Click to read more »match(matchrow_str, '^([^,]*),?') end local match_str = Args[prefix..'match_' .. ti .. '_' .. tj] or '' local game_count = 1 while match_str ~= ''...
Click to read more »str if ritiro == nil then ritiro = 0 end if max[ritiro]-gare[anno] ~= 0 then str = "||width=3%| " for i=2,(max[ritiro]-gare[anno]) do str = str ...
Click to read more »table. local function iterBytes(str, func) local out = {} for i = 1, #str do table.insert(out, func(string.byte(str, i))) end return out end local...
Click to read more »local function unescape(str) return str:gsub("\\(%d%d%d)", function (d) return string.char(d) end) end local function unpack(str) local result = {}...
Click to read more »str = str .. completeMonths[myDate.month] .. " " .. myDate.day .. ", " .. myDate.year elseif(outputFormat=="iso")then str = str .. myDate...
Click to read more »local p = {} -- Mapping of string inputs to boolean values local STR_BOOL = { ["yes"] = true, ["y"] = true, ["true"] = true, ["t"] = true...
Click to read more »is_set(str) then return str; else if str:sub(1,1) == "'" then str = "<span />" .. str; end if str:sub(-1,-1) == "'" then str =...
Click to read more »local ret = {} ret.test = function(str) return "Data: " .. str.args[1] end return ret...
Click to read more »function cleanTeam(str, defaultName) if str and str ~= "" then str = str:gsub('<sup.->.-</sup>', '') str = str:gsub("</?%w+[^>]*>"...
Click to read more »isNoWikiStripMarker(str) return string.match (str, '^%s*\127[^\127]*UNIQ%-%-nowiki%-%x%x%x%x%x%x%x%x%-QINU[^\127]*\127%s*$') end function firstToUpper(str) return...
Click to read more »function split_once(str, delimiter) local pos = mw.ustring.find(str, delimiter, 1, true) if pos then return mw.ustring.sub(str, 1, pos - 1),...
Click to read more »function p.main(frame) local shop_value_str = frame.args[1] local shop_value = tonumber(shop_value_str) -- :expandTemplate -- Check he the conversion...
Click to read more »then str = str .. " It is warm." elseif cels < 9 then str = str .. " It is cold." else str = str .. " It isn't neither warm nor cold." end return str end...
Click to read more »json') end local function primary (str) return mw.ustring.match(str, '^%a+') end local function isNegative (str) local neg = { ['nil'] = true...
Click to read more »s:match '^%s*(.*)' end local function split_with_comma(str) local fields = {} for field in str:gmatch('([^,]+)') do fields[#fields + 1] =...
Click to read more »@param {string} str Input string -- @param {number} limit Word count limit -- @return table with necessary outputs function p._main(str, limit) local...
Click to read more »function wd.translate(str, rep1, rep2) str = databases.i18n[str] or str if rep1 and (type (rep1) == 'string') then str = str:gsub('$1', rep1) end...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature =...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »local p = {}; p.participants = function(frame) local str = frame.args.name return str end return p...
Click to read more »world' end function p.Hi(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »match(bgcol_str, '^([^%+]*)%+?') or '' bgcol_str = mw.ustring.gsub(bgcol_str, '^([^%+]*)%+?', '') or '' -- Remove bg_col from bgcol_str bg_col...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »(comma-separated words) local exclude_str = frame.args.exclude or '' local exclude = {} for word in string.gmatch(exclude_str, '[^,]+') do exclude[mw...
Click to read more »function cleanTeam(str, defaultName) if str and str ~= "" then str = str:gsub('<sup.->.-</sup>', '') str = str:gsub("</?%w+[^>]*>"...
Click to read more »{string} str Multiline string indented consistently. -- @returns {string} Unindented string. return function(str) str = str:gsub(' +$'...
Click to read more »function(frame) local str = frame.args.words or "" local str = str:gsub("^%l", string.upper) local out = string.sub(str, 2) local out = str return out end...
Click to read more »local p = {}; p.cadmium = function( frame ) local str = "Cadmium is a toxic metal." return str end return p...
Click to read more »i- for iso ['n'] = true, ['i'] = true } function p.format(in_str) local out = in_str or '' local i -- position in 'out' string to analyze local function...
Click to read more »function split(str, del, from) local i, j from = from or 1 i, j = str:find(del, from) if i and j then return str:sub(1, i - 1), str:sub(j + 1), i...
Click to read more »str) if type(str) ~= "string" then return nil end local script_to_count = script_to_count_mt() for codepoint in mw.ustring.gcodepoint(str)...
Click to read more »2017, Introduction to Lua in Wikipedia my_object = {} my_object.hello = function(frame) local str = "Hello World!" return str end return my_object...
Click to read more »function wd.translate(str, rep1, rep2) str = modules.i18n[str] or str if rep1 and (type (rep1) == 'string') then str = str:gsub('$1', rep1) end ...
Click to read more »local str = frame.args[1] or "dat" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »"):format(type(str)), 2) end str = str:gsub("^[%c ]+", "") str = str:gsub("[%c ]+$", "") local strlen = #str if strlen == 1 then return nil...
Click to read more »local t={} for str in string.gmatch(inputstr, "([^"..sep.."]+)") do table.insert(t, str) end return t end...
Click to read more »terminating the string. unindent( str ) (function) Unindent resets the indentation level of mulitline strings. Parameter: str Multiline string indented consistently...
Click to read more »local dateStr = langSwitch(i18n.Translations[operation], lang) if type(dateStr)=='table' then dateStr = dateStr[1] end if type(dateStr)=='function'...
Click to read more »local p = {}; p.languages = function(frame) local str = "Language yet to be deffined" return str end return p...
Click to read more »match(bgcol_str, '^([^%+]*)%+?') or '' bgcol_str = mw.ustring.gsub(bgcol_str, '^([^%+]*)%+?', '') or '' -- Remove bg_col from bgcol_str bg_col...
Click to read more »local function nl () local str = 'string with newlines: single\nhere;\n\ndouble here;\n\n\ntripple here.' return str; end return {nl=nl}...
Click to read more »sentence = function(frame) local str = frame.args.words or "" local out = string.upper(string.sub(str, 1, 1)) .. string.sub(str, 2) return out end p.unpackdate...
Click to read more »line in the wiki code editor) ]] local function tabbing (str) return math.ceil ((80 - 4 - str:len()) / 4); -- the -4 because every line begins...
Click to read more »["Str_count"] = 166000, ["Str_endswith"] = 236000, ["Str_find"] = 283000, ["Str_index"] = 15000, ["Str_left"] = 348000, ["Str_len"] = 167000, ["Str_letter"]...
Click to read more »{} local function get_all_codepoints(str) local codepoint_set = {} for codepoint in mw.ustring.gcodepoint(str) do codepoint_set[codepoint] = true...
Click to read more »local p = {}; p.rugby = function( frame ) local str = "Rugby player stats" return str end return p...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »my_object = {} my_object.hello = function( frame ) local str = "Hello Sdsds!" return str end return my_object...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end --StoppedGalaxy...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »function trim(str) --Trims strings, passes through non-strings without modification return (type(str) == 'string') and mw.text.trim(str) or str end local...
Click to read more »convert_dms2dec(direction, degrees_str, minutes_str, seconds_str) local degrees = tonumber(degrees_str) local minutes = tonumber(minutes_str) or 0 local seconds...
Click to read more »end function p.is_Latin(str) require "libraryUtil".checkType("get_best_script", 1, str, "string") str = mw.text.decode(str, true) -- Search for the...
Click to read more »isLuaIdentifier(str) return type(str) == "string" -- Must start with a-z, A-Z or underscore, and can only contain -- a-z, A-Z, 0-9 and underscore and str...
Click to read more »convert_dms2dec(direction, degrees_str, minutes_str, seconds_str) local degrees = tonumber(degrees_str) local minutes = tonumber(minutes_str) or 0 local seconds...
Click to read more »objects_str = objects_str .. object:to_svg() .. "\n" end return header .. "\n<defs>\n<style>\n" .. styles_str .. "\n</style>\n" .. definitions_str .....
Click to read more »highlight_diff(str) if mw.ustring.find(str, "%s") then return '<span style="background-color: var(--wikt-palette-red-4,pink);">' .. string.gsub(str, " ",...
Click to read more »last three chars of str are sepc'' str = f.sub(str, 1, -4) .. "''"; -- remove them and add back '' elseif f.sub(str, -5, -1) == duplicate_char...
Click to read more »sentence = function(frame) local str = frame.args.words or "" local out = string.upper(string.sub(str,1,1)) .. string.sub(str, 2) return out end p.unpackdate...
Click to read more »values, or "false" if no numeric argument is given -- units: list of units (str) -- value: if there is a last numeric value unpaired with a unit, it becomes...
Click to read more »local function str_split(inputstr, sep) local t = {} for str in string.gmatch(inputstr, "([^"..sep.."]+)") do table.insert(t, str) end ...
Click to read more »" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »timestamp, lang}}); -- get the genitive month name total_fmt_str_len = total_fmt_str_len + 2; -- accumulate format string length local month_nom...
Click to read more »'xg', timestamp ); -- get the genitive month name total_fmt_str_len = total_fmt_str_len + 2; -- accumulate format string length local month_nom...
Click to read more »padDigits or 0 local str if padDigits > 0 then str = string.format("%0" .. padDigits .. "d", num) else str = tostring(num) ...
Click to read more »not is_set(str) then return str; else if str:sub(1,1) == "'" then str = "<span />" .. str; end if str:sub(-1,-1) == "'" then str = str .. "<span...
Click to read more »return frame:expandTemplate{ title = 'convert', args = targs} .. str else return str end end function p.length(frame) return convert_length(frame...
Click to read more »world!" end function p.Hi(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »increment issue number "{{Str right|{{Wikipedia:Wikipedia Signpost/Templates/Issue|2}}|10}}", "issue {{#expr:1+{{Str right|{{Wikipedia:Wikipedia...
Click to read more »sentence = function(frame) local str = frame.args.words or "" local out = string.upper(string.sub(str, 1, 1)) .. string.sub(str, 2) return out end p.unpackdate...
Click to read more »compat') --[[ Infrastructure ]]-- function split(str) lines = {} for s in string.gmatch(str, "[^\r\n]+") do table.insert(lines, s) end...
Click to read more »while true do local nextOpen = string.find(str, "{{", position, true) local nextClose = string.find(str, "}}", position, true) if nextOpen and (not...
Click to read more »World!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end -- cheddarooz Google...
Click to read more »-- Copied from Module:String's `str._escapePattern()` local function escape_pattern (str) return (string.gsub(str, "[%(%)%.%%%+%-%*%?%[%^%$%]]", "%%%0"))...
Click to read more »values, or "false" if no numeric argument is given -- units: list of units (str) -- value: if there is a last numeric value unpaired with a unit, it becomes...
Click to read more »local arguments_str = input:match(pattern) local args = {} if arguments_str then for arg in arguments_str:gmatch("[^,]+") do...
Click to read more »end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end -- Task 3 p...
Click to read more »coordsDerivedFromFeatures = ( argType == L10n.str.line or argType == L10n.str.shape ) and true or false end if argType == L10n.str.named then local namedCoords...
Click to read more »last three chars of str are sepc'' str = f.sub(str, 1, -4) .. "''"; -- remove them and add back '' elseif f.sub(str, -5, -1) == duplicate_char...
Click to read more »for str in string.gmatch(inputstr, '([^'..sep..']+)') do -- insert the substring in table table.insert(t, str) end ...
Click to read more »str = "The given name is <b>" for z, name in ipairs(name.givenNames) do str = str .. " " .. name end str = str .. "</b>.<br>" else str =...
Click to read more »local gsub = mw.ustring.gsub local function lc(str) return mw.getLanguage("(insert lang here)"):lc(str) end -- IPA transcription function export.toIPA(entry)...
Click to read more »function(frame) local str = frame.args.words or "" local out = string.sub(str, 1, 1) out = string.upper(out) local run = string.sub(str, 2, #str) out = out...
Click to read more »debugStr = '{{Redirect template<br />\n' for k,v in pairs( outArgs ) do debugStr = debugStr..'| '..k..' = '..v..'<br />\n' end outStr = debugStr....
Click to read more »Split(str, delim, maxNb) -- Eliminate bad cases... if string.find(str, delim) == nil then if str == "" then return {} else return {str} end...
Click to read more »]] l.escape = function(str) if string.find( str, ".", 1, false) then -- need to esc the . local s = mw.text.split( str, "%.", plain ) return...
Click to read more »sep for str in string.gmatch(inputstr, '([^'..sep..']+)') do -- insert the substring in table table.insert(t, str) end --...
Click to read more »return frame:expandTemplate{ title = 'convert', args = targs} .. str else return str end end function p.weight(frame) return convert_weight(frame...
Click to read more »background: inherit; border: none; padding: inherit;'; local warning_fmt_str = '<span style="%s"><code style="%s">{{[[Template:%s|%s]]}}</code>:...
Click to read more »returning a string. ]] function l.trim(str) str = mw.text.trim(str) if str == nil then str = "" end return str end --[[ Ensure double .. is present...
Click to read more »require("Module:Docbunto") local suite = require('Module:ScribuntoUnit').new() local str = require("Module:String") local function testWikitext( wikitext, that )...
Click to read more »loadData("Module:Citation/CS1/Configuration") local function safe_for_url( str ) return str:gsub( '[%[%]\n]', { ['['] = '[', [']'] = ']', ['\n']...
Click to read more »str = str .. suffix if type(targs) == 'table' then return frame:expandTemplate{ title = 'convert', args = targs} .. str else return str end...
Click to read more »= function(frame) local str = frame.args.words or "" local out = string.upper( string.sub(str, 1, 1) ) .. string.sub(str, 2) return out end p.unpackdate...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »sentence = function(frame) local str = frame.args.words or "" local out = string.sub(str, 2) out = str.upper(string.sub(str, 1, 1))..out return out ...
Click to read more »various list syntax. -- -- @param str string -- @return string local function clean_list_syntax(str) str = string.gsub(str, "\127[^\127]*UNIQ%-%-(%a+)%-...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »Hi(frame). Some people prefer one way over the other strName = frame.args.name or "Jimbo" --str* is just a hint that a string is expected. args is the...
Click to read more »'')) ) then outStr = outStr..', ' end if i == maxArg then outStr = outStr..' '..(args['c'] or 'and') .. ' ' end end outStr = string.format(...
Click to read more »end function p.brackets(frame) return "[" .. frame.args[1] .. "]" end function p.quoteStr(frame) return "\"" .. frame.args.str .. "\"" end return p...
Click to read more »require("strict") local str = require("Module:String") local p = {} -- Template with placeholders: {{DOMAIN}} for domain, {{ENCODED}} for URL-encoded...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(...
Click to read more »end p.Hi = function(frame) strName = frame.args.name or "Jimbo" -- Step 13 return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »functions.loopnum(frame) str = "" for i=1, tonumber(frame.args[1]) do str = str .. "\n\n" .. spelledout(i) end return str end return functions...
Click to read more ») local definition_str = nil return style_str, definition_str elseif self.fill_style.name == 'Solid' then ...
Click to read more »'Module:RedirectChecker/config.json' ) local function isEmpty( str ) return str == nil or str == '' end local function getConfigVal( key ) if not isEmpty(...
Click to read more »0xFE00, last = 0xFE0F, str = "VS<br>", startNum = 1}, -- Block: Variation Selectors Supplement {first = 0xE0100, last = 0xE01EF, str = "VS<br>", startNum...
Click to read more »split(str, pat) local t = {} -- NOTE: use {n = 0} in Lua-5.0 local fpat = "(.-)" .. pat local last_end = 1 local s, e, cap = str:find(fpat...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end --return p --...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »sentence = function(frame) local str = frame.args.words or "" local out = string.upper(string.sub(str, 1, 1)) .. string.sub(str, 2) return out end p.unpackdate...
Click to read more »function(frame) local str = frame.args.words or "" local out1= string.upper(string.sub(str, 1, 1)) local out2 = string.sub(str, 2) return out1..out2...
Click to read more »debugStr = '{{Redirect template<br />\n' for k,v in pairs( outArgs ) do debugStr = debugStr..'| '..k..' = '..v..'<br />\n' end outStr = debugStr....
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »opening_str, -- open the translation table table.concat (out_t, ',\n\t\t'), -- add the non-enumerated parameters enum_out_str, ...
Click to read more »expandRange(str) if not str or str == '' then return nil end str = mw.text.trim(str) local s, e = str:match('^(.-)%-(.+)$') if not s then s, e = str, str end...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end -- smsingh Task...
Click to read more »functions local strIndexOf = mw.ustring.find local strSplit = mw.text.split local strSub = mw.ustring.sub local strTrim = mw.text.trim...
Click to read more »function Superscript( str, superscript, nosup, period ) if superscript and (not nosup) and (str ~= '') then return period .. '<sup>' .. str .. '</sup>' else...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end --Task 3 function...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »'')) ) then outStr = outStr..', ' end if i == maxArg then outStr = outStr..' '..(args['c'] or 'and') .. ' ' end end outStr = string.format(...
Click to read more »expandRange(str) if not str or str == '' then return nil end str = mw.text.trim(str) local s, e = str:match('^(.-)%-(.+)$') if not s then s, e = str, str end...
Click to read more »while true do local nextOpen = string.find(str, "{{", position, true) local nextClose = string.find(str, "}}", position, true) if nextOpen and (not...
Click to read more »return (s:gsub("^%s*(.-)%s*$", "%1")) end function parseString(str) local mys = str:match("! User groups\n(.*)|}"):sub(2) local rankTable = split(mys:sub(3)...
Click to read more »local title = frame.args[1] local str = mw.wikibase.getEntityIdForTitle( title ) return str end function p.count_temp(frame) -- {{#invoke:Sandbox/Mr...
Click to read more »return frame:expandTemplate{ title = 'convert', args = targs} .. str else return str end end function p.length(frame) return convert_length(frame...
Click to read more »element from list local function matchPhoneme(str, list) for _, phoneme in ipairs(list) do if str:sub(1, #phoneme) == phoneme then ...
Click to read more »return frame:expandTemplate{ title = 'convert', args = targs} .. str else return str end end function p.weight(frame) return convert_weight(frame...
Click to read more »underscore_to_camel_case(str) if type(str) ~= "string" then return str end str = str:gsub("_(.)", string.upper) return str end local m_table, m_fun...
Click to read more »clean_input(str) if not str then return "" end -- Remove leading/trailing spaces and strip out literal wiki formatting if accidentally passed str =...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »newFromIPv6(ipStr) -- Return a RawIP object if ipStr is a valid IPv6 string. Otherwise, -- return nil. ipStr = ipStr:match('^%s*(.-)%s*$') local _, n = ipStr:gsub(':'...
Click to read more »isBadTitle(str) if str == nil then return true end if type(str) == "number" then str = mw.ustring.char(str) end if not mUnicode.is_valid_pagename(str) then...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »DEFAULT_BORDER = "#a2a9b1" local function normalizeKey(str) if not str then return nil end str = tostring(str):lower() :gsub("^%s+", "") :gsub("%s+$"...
Click to read more »various list syntax. -- -- @param str string -- @return string local function clean_list_syntax(str) str = string.gsub(str, "\127[^\127]*UNIQ%-%-(%a+)%-...
Click to read more »#string formatStr The string the be substituted -- @param #table args The arguments passed to this module local function subst(formatStr, args) --- --...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »normalise(str) return mw.ustring.gsub(str,"[" .. conf.WordSeparator .. "]+"," ") end local function tidyCss(str) str = mw.ustring.gsub(str, '^[\"\']*(...
Click to read more »as a string or a number local function get_parameter_name (par_str) local ret = par_str:match'^%s*(.-)%s*$' if ret ~= '0' and ret:find'^%-?[1-9]%d*$'...
Click to read more »str = str .. suffix if type(targs) == 'table' then return frame:expandTemplate{ title = 'convert', args = targs} .. str else return str end...
Click to read more »DEFAULT_BORDER = "#a2a9b1" local function normalizeKey(str) if not str then return nil end str = tostring(str):lower() :gsub("^%s+", "") :gsub("%s+$"...
Click to read more »has_accept_as_written() if not utilities.is_set (str) then return str; end local accept; -- Boolean str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—']...
Click to read more »targs, str = get_convert_weight_args(args[1]) if type(targs) == 'table' then return frame:expandTemplate{ title = 'convert', args = targs} .. str else...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »Task 2 p.Hi = function ( frame ) strName = frame.args.name or "Jimbo" return "Hello from Lua module to " .. strName .. ".<br/>" end -- Task 3 function...
Click to read more »forSeeStr = string.format(options.forSeeForm, useStr, pagesStr) forSeeStr = punctuationCollapse(forSeeStr) table.insert(strList, forSeeStr) end...
Click to read more »local strFind = string.find local strMatch = string.match local strSplit = mw.text.split local strFormat = string.format local strTrim =...
Click to read more »array end function p.list_chars_in_script(str) local scripts = {} for codepoint in mw.ustring.gcodepoint(str) do local script = cp_to_sc(codepoint)...
Click to read more »-------------------------- local p = {} function p.image(number) local str num = number.args[1] return ("[[File:China Expwy"..string.upper(num).."sign...
Click to read more »true else strOut = strOut .. replaceSpecialChar(chr) end else strOut = strOut .. chr esc = false end end return strOut end local...
Click to read more »return '/' end; local str; if sep_param_val:match ('^%b\"\"$') then -- if quoted string and uses double quotes str = sep_param_val:match ('%b\"\"'):gsub...
Click to read more »-- {{xviews/view count}} local str = string.gsub(getContent(page), '.?202%d%-%d%d%-%d%d', '') str = string.gsub(str, ',', '', 1) -- Remove leading...
Click to read more »local dateStr = langSwitch(i18n.Translations[operation], lang) if type(dateStr)=='table' then dateStr = dateStr[1] end if type(dateStr)=='function'...
Click to read more »militaryDecorations.makeTemplate = function(frame) strOut = frame.args.pre and "<pre>" or "" strOut = strOut .. "{|class='wikitable'\n" row = 1 col = 1...
Click to read more »function get_raw_text(str) local builder = "" for index=1,string.len(str),1 do local ch = string.sub(str,index,index) if ( ch == ' ' or...
Click to read more »require('strict') local p = {} local pargs = {} local function firstToUpper(str) return (str:gsub("^%l", string.upper)) end local function getArgs (frame, args)...
Click to read more »require('Module:Module wikitext')._addText("{{Humor}}") function spellChecker(str, replacements) local function adjust_case(first, second, disable_case_transmission)...
Click to read more »com/a/14899740/1832568 local function _unescape(str) str = mw.ustring.gsub(str, '&#(%d+);', string.char) str = mw.ustring.gsub(str, '&#x(%d+);', function(d) return...
Click to read more »coordsDerivedFromFeatures = ( argType == L10n.str.line or argType == L10n.str.shape ) and true or false end if argType == L10n.str.named then local namedCoords...
Click to read more »Gets the display text from a wikilink like [[A|B]] or [[B]] gives B The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »targs, str = get_convert_weight_args(args[1]) if type(targs) == 'table' then return frame:expandTemplate{ title = 'convert', args = targs} .. str .. tracking_category...
Click to read more »forSeeStr = string.format(options.forSeeForm, useStr, pagesStr) forSeeStr = punctuationCollapse(forSeeStr) table.insert(strList, forSeeStr) end...
Click to read more »if #args > 2 then outStr = outStr..', ' end if i == #args then outStr = outStr..' and ' end end outStr = outStr..rootpage..'/'..args[i]..'|'...
Click to read more »purif(str) if str == "" or str == nil then return nil elseif type(tonumber(str)) == "number" then return math.floor(tonumber(str))...
Click to read more »'Template:Isopsephy'}) str = args[1] local html = "" sum = 0 if args.lang and str then local words = parseStrToTable(str) if rightToLeft[args...
Click to read more »true else strOut = strOut .. replaceSpecialChar(chr) end else strOut = strOut .. chr esc = false end end return strOut end function...
Click to read more »full version. local p = {}; p.hello = function( frame ) local str = "Hello World!" return str end return p Access to this code will be through a generic...
Click to read more »true else strOut = strOut .. replaceSpecialChar(chr) end else strOut = strOut .. chr esc = false end end return strOut end -- encodes...
Click to read more »language use. In this module, num_str is limited by calling functions to the integer values 1-99. The argument num_str must be known to be set before this...
Click to read more »elseif v == "" then v = "[blank]" end outStr = outStr..'\n'..k..' = \t'..v..'\n' end outStr = outStr..'\niPairs:\n' for k, v in ipairs(args)...
Click to read more »decodeEntities(str) str = str:gsub(" ", " ") str = mw.text.decode(str, true) return str end -- Delink wikilinks local function delink(str) return str:gsub("%[%[(...
Click to read more »--- function ia_url_encode(str) if (str) then str = mw.ustring.gsub (str, "\n", "\r\n") str = mw.ustring.gsub (str, "([^%w %-%_%.%~])", ...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »if there is no match function findcountryinstring(str) nMatches = 0 myMatches ={} str=" " .. str:gsub("^%s*(.-)%s*$", "%1") .. " " -- check agaist...
Click to read more »normalise(str) return mw.ustring.gsub(str,"[" .. conf.WordSeparator .. "]+"," ") end local function tidyCss(str) str = mw.ustring.gsub(str, '^[\"\']*(...
Click to read more »end local function resolveTimestamp(date_str) local raw, err = date_str and timestamp(date_str) or timestamp() if not raw then return...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »local strFind = string.find local strMatch = string.match local strSplit = mw.text.split local strFormat = string.format local strTrim =...
Click to read more »true else strOut = strOut .. replaceSpecialChar(chr) end else strOut = strOut .. chr esc = false end end return strOut end local...
Click to read more »true else strOut = strOut .. replaceSpecialChar(chr) end else strOut = strOut .. chr esc = false end end return strOut end local...
Click to read more »escape a string for use in regexes function Excerpt.escapeString( str ) return str:gsub( '[%^%$%(%)%.%[%]%*%+%-%?%%]', '%%%0' ) end -- Helper method...
Click to read more »(given the WBSC rankings begin in cell A1): ="| {{subst:str sub old|"&B1&"|0|3}} = "&A1&" | {{subst:str sub old|"&B1&"|0|3}}_move = "&E1 The code generated...
Click to read more »{} local output_mt = {} function output_mt:insert(str) self.n = self.n + 1 self[self.n] = str end function output_mt:insert_format(...) self:insert(string...
Click to read more »errors = {} for parameter, dateStr in pairs(frame.args) do dateStr = mw.text.trim(dateStr) if string.lower(dateStr) == "until" then isUntil = true...
Click to read more »local p={} local lib_arg={} local lib_str=mw.ustring local yesno = require('Module:Yesno') local main_template_name = "Variable" local module_call ="#invoke:Var"...
Click to read more »return "[[" .. strNamespace.. ":" .. strTitle .. "|" .. strTitle .. "]] [[[Special:Edit/" .. strNamespace .. ":" .. strTitle .. "|edit]]<br />...
Click to read more »local strFind = string.find local strMatch = string.match local strSplit = mw.text.split local strFormat = string.format local strTrim =...
Click to read more »yStr, mStr, dStr = dateInput:match("(%d%d%d%d)-(%d%d?)-(%d%d?)") if yStr then year = tonumber(yStr) m = tonumber(mStr)...
Click to read more »strName = frame.args[1] or mw.title.getCurrentTitle() return "[[Module:" .. strName .. "|" .. strName .. "]] [[[Module talk:" .. strName...
Click to read more »if there is no match function findcountryinstring(str) nMatches = 0 myMatches ={} str=" " .. str:gsub("^%s*(.-)%s*$", "%1") .. " " -- check agaist...
Click to read more »p.Hi = function(frame) local strName strName = frame.args.name or "oge" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »{{nums}} {{strs}} Module:Sandbox/Grufo {{key|}} {{nums}} {{strs}} Module:Sandbox/Grufo {{key|'"`UNIQ--nowiki-00000000-QINU`"'}} {{nums}} {{strs}} Module:Sandbox/Grufo...
Click to read more »if #args > 2 then outStr = outStr..', ' end if i == #args then outStr = outStr..' and ' end end outStr = outStr..delsortRoot..'/'..args[i]...
Click to read more »split( String, '"', true )) do if i%2==1 then str = str:gsub(old, new) end table.insert(T, str) end return table.concat(T,'"') else return...
Click to read more »local function remove_wiki_link (str) return (str:gsub( "%[%[([^%[%]]*)%]%]", function(l) return l:gsub( "^[^|]*|(.*)$", "%1" ):gsub("^%s*(.-)%s*$"...
Click to read more »normalize_string(input_str, type_flag) if not input_str or input_str == "" then return "" end local s = mw.ustring.lower(input_str) -- PREVENT...
Click to read more »text.trim(org), '\\'), '\\') --return table.concat(mw.text.split([[\\\STR\STR\\]], '\\'), '\\') end function p.trimmer2(frame) -- Trims first and last...
Click to read more »local strFind = string.find local strMatch = string.match local strSplit = mw.text.split local strFormat = string.format local strTrim =...
Click to read more »-- Start building the table local tableStr = '{| class="wikitable"\n' tableStr = tableStr .. "! " .. lang1 .. " !! " .. lang2 .. "\n" ...
Click to read more »functions local strIndexOf = mw.ustring.find local strSplit = mw.text.split local strSub = mw.ustring.sub local strTrim = mw.text.trim...
Click to read more »normalise(str) return mw.ustring.gsub(str,"[" .. conf.WordSeparator .. "]+"," ") end local function tidyCss(str) str = mw.ustring.gsub(str, '^[\"\']*(...
Click to read more »templates when counting words. Word_count._main( str, limit ) (function) Main entry point for modules Parameters: str Input string (string) limit Word count limit...
Click to read more »THIS PAGE local p = {} p.Hi = function(frame) strName = frame.args.name return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »p._error( error_str ) return '[[Category:Duration with input error]]<strong class="error">Error in Module:Duration: ' .. error_str .. '</strong>' end...
Click to read more »str = tostring(num) local result = '' local negative = false if str:sub(1, 1) == "-" then negative = true str = str:sub(2)...
Click to read more »errors = {} for parameter, dateStr in pairs(frame.args) do dateStr = mw.text.trim(dateStr) if string.lower(dateStr) == "until" then isUntil = true...
Click to read more »Disparate: %s]], strMap(Set.valueIntersection(baseParams, otherParams), function(v) return string.format('* %s\n', v) end), strMap(Set...
Click to read more »local strFind = string.find local strMatch = string.match local strSplit = mw.text.split local strFormat = string.format local strTrim =...
Click to read more »local str = tostring(v)--functions not filtered since unlikely passed by accident (Scribunto does not have userdata/thread types) if str~=v and str=='table'...
Click to read more »alias .. "}}}" end end local function replaceTripleBraces(str, i) -- extract corresponding arguments from the parent function. ----...
Click to read more »function(frame) strTitle = frame.args.title strLabel = frame.args.label or "WhatLinksHere" strNamespace = frame.args...
Click to read more »local outStr = '' for i = 1, maxArg do if args[i] then outStr = outStr..'[[:User:'..args[i]..'|​]]' end end return outStr end end return...
Click to read more »function purif(str) if str == "" or str == nil then return nil elseif tonumber(str) then return math.floor(tonumber(str)) else...
Click to read more »Greek|translit|οἷος}} hoîos The code below uses the basic string functions (for instance, str:gsub(...)) when possible. Ustring functions have to be used when patterns...
Click to read more »(given the WBSC rankings begin in cell A1): ="| {{subst:str sub old|"&B1&"|0|3}} = "&A1&" | {{subst:str sub old|"&B1&"|0|3}}_move = "&E1 The code generated...
Click to read more »com/a/14899740/1832568 local function unescape(str) str = string.gsub(str, '&#(%d+);', string.char) str = string.gsub(str, '&#x(%d+);', function(d) return string...
Click to read more »outStr = mw.ustring.gsub( string.format( '%s[[:%s|%s]]%s', delim, fullPage, page, endDelim ), ':+', ':' ) end return outStr end...
Click to read more »(given the FIVB rankings begin in cell A1): ="| {{subst:str sub old|"&B1&"|0|3}} = "&A1&" | {{subst:str sub old|"&B1&"|0|3}}_move = "&E1 The code generated...
Click to read more »unmodified. str may be a comma- or semicolon-separated list ]] local function hyphen_to_dash( str ) if not utilities.is_set (str) then return str; end...
Click to read more »various list syntax. -- -- @param str string -- @return string local function clean_list_syntax(str) str = string.gsub(str, "\127[^\127]*UNIQ%-%-(%a+)%-...
Click to read more »with Cite taxon errors]]" end end local function firstToUpper(str) return (str:gsub("^%l", string.upper)) end -- define citation template and custom...
Click to read more »-- Create xLabels for str in string.gmatch(args["x labels"], "([^,]+)") do table.insert(xLabels,str) xLCount = xLCount+1 ...
Click to read more »= num } end local function flag(str) return frame:expandTemplate{ title = 'flag', args = { str } } end local args = frame.args ...
Click to read more »= {} p.main = function(frame) strTitle = frame.args.title or 'Example' strLabel = frame.args.label or "Subpages of this page"...
Click to read more »unmodified. str may be a comma- or semicolon-separated list ]] local function hyphen_to_dash( str ) if not is_set (str) then return str; end str, count...
Click to read more »end --return "<nowiki>" .. res .. "</nowiki>" return res end function p.firstToUpper(str) return (str:gsub("^%l", string.upper)) end return p...
Click to read more »count}} local str = string.gsub(getContent(page), '.?202%d%-%d%d%-%d%d', '') str = string.gsub(str, ',', '', 1) -- Remove leading...
Click to read more »"y"}) would both give back {x="a", y="b"}. Takes 1 required argument boolean_str. Turns the input into a true/false boolean value based on the input. Will...
Click to read more »empties; optional number-cast. function Helpers.split(str, delim, tonum) if Helpers.isempty(str) then return {} end local result, buf = {}, {} ...
Click to read more »== 'string' then -- split multi keys for str in string.gmatch(name, "([^/]+)") do args1[str] = value end end end return p._langSwitch(args1...
Click to read more »empties; optional number-cast. function Helpers.split(str, delim, tonum) if Helpers.isempty(str) then return {} end local result, buf = {}, {} ...
Click to read more »or punctaution charaters function splitIntoWords(str) result = {} index = 1 s = mw.ustring.gsub(str, "^[%s%p]+", "") -- strip leading whitespace or...
Click to read more »--I18nStr function p.GetMsgP (TNTTab, S, ...) return I18nStr (TNTTab, S, true, {...}) end function p.GetStrP (TNTTab, S, ...) return I18nStr (TNTTab...
Click to read more »com/a/14899740/1832568 local function unescape(str) str = string.gsub(str, '&#(%d+);', string.char) str = string.gsub(str, '&#x(%d+);', function(d) return string...
Click to read more »local str = tostring(v)--functions not filtered since unlikely passed by accident (Scribunto does not have userdata/thread types) if str~=v and str=='table'...
Click to read more »last three chars of str are sepc'' str = f.sub(str, 1, -4) .. "''"; -- remove them and add back '' elseif f.sub(str, -5, -1) == duplicate_char...
Click to read more »function(frame) local strName strName = frame.args.name or "3LetterInitials" return "Hello from Lua to my friend " .. strName .. ".<br>" end return...
Click to read more »unmodified. str may be a comma- or semicolon-separated list ]] local function hyphen_to_dash( str ) if not utilities.is_set (str) then return str; end...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »split( String, '"', true )) do if i%2==1 then str = str:gsub(old, new) end table.insert(T, str) end return table.concat(T,'"') else return...
Click to read more »escapeString(str) return tostring(str):gsub('[%^%$%(%)%.%[%]%*%+%-%?%%]', '%%%0') end local function removeString(text, str) local pattern = escapeString(str)...
Click to read more »target table, e.g. fishbase, cof, etc local function firstToUpper(str) return (str:gsub("^%l", string.upper)) end -- define citation template and custom...
Click to read more »coordsDerivedFromFeatures = ( argType == L10n.str.line or argType == L10n.str.shape ) and true or false end if argType == L10n.str.named then local namedCoords...
Click to read more »(singles_out_t) do local single_str = string.format ('[%s] = true,', v); local rep = math.ceil ((80 - (4 + single_str:len())) / 4); singles_out_t[i]...
Click to read more »function p._error( error_str ) return '[[Category:Duration with input error]]<strong class="error">Error in Module:Hms: ' .. error_str .. '</strong>' end...
Click to read more »-- Create xLabels for str in string.gmatch(args["x labels"], "([^,]+)") do table.insert(xLabels,str) xLCount = xLCount+1 ...
Click to read more »"|Talk]] • [[Special:Contributions/" .. name .. "|Contribs]]" end function p.firstToUpper(str) return (str:gsub("^%l", string.upper)) end return p...
Click to read more »or punctaution charaters function splitIntoWords(str) result = {} index = 1 s = mw.ustring.gsub(str, "^[%s%p]+", "") -- strip leading whitespace or...
Click to read more »local str_number = tostring(number) local highest_numeric_position = #str_number local i = 0 local index = '' for digit in str_number:gmatch"...
Click to read more »Gets the display text from a wikilink like [[A|B]] or [[B]] gives B The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink...
Click to read more »function(frame) strName = frame.args.name or "Jimmy" strName1 = frame.args.yourname return "Hello from Lua to my friend " .. strName .. ".<br>" end...
Click to read more »localSeparatorStr = "," -- **lclz** Correct it if your wiki has different setting, like zhwiki uses "、" for now local localNotApplicableStr = "n/a" -- **lclz**...
Click to read more »sources/Perennial sources" local function getWikilinks(str) local out = {} for part in str:gmatch("%[%b[]%]") do table.insert(out, part:sub(3, -3))...
Click to read more »local text, icon_image, icon_str if class=='NA' then icon_image = cfg.icons.type[pagetype] or cfg.icons.default icon_str = pagetype=='page' and 'Non-article...
Click to read more »local str = mw.text.trim( v ) if str == '' then -- do nothing else -- local name or canonical name, at english only canonical name if str:match(...
Click to read more »local text, icon_image, icon_str if class=='NA' then icon_image = cfg.icons.type[pagetype] or cfg.icons.default icon_str = pagetype=='page' and 'Non-article...
Click to read more »local styleStr = "" --widthStr = 'width:' .. (longestString*0.5)..'em;' -- can't take account of formatting or <br/> if width then styleStr = 'style="width:'...
Click to read more »unmodified. str may be a comma- or semicolon-separated list ]] local function hyphen_to_dash( str ) if not is_set (str) then return str; end str, count...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »remove_container (str) local count; str, count = str:gsub( "<([^>]*)>", function(l) return l:gsub("^%s*(.-)%s*$", ""); end); return str, 0 < count...
Click to read more »'#C96', '#f9f9f9'}, reuseStr = {}, saveStr = function(self, name, ...) if not self.reuseStr[name] then self.reuseStr[name] = table.concat{...}...
Click to read more »description", args = {text, "noreplace"}} end function p.firstToUpper(str) return (str:gsub("^%l", string.upper)) end function p.main(frame) if (isInLead("[Ii]nfobox...
Click to read more »function(frame) local strName strName = pizza.args.name or "pepperoni" return "It's flavored italian pepperoni pizza! " .. strName .. ".<br>" end return...
Click to read more »local Array = require 'Module:Array' local function pattern_escape(str) return (str:gsub('%p', '%%%1')) end function p.make_script_name_to_code(page_name)...
Click to read more »outStr = mw.ustring.gsub( string.format( '%s[[:%s|%s]]%s', delim, fullPage, page, endDelim ), ':+', ':' ) end return outStr end...
Click to read more »newIndex or nil. local function readAtomSymbol(str, i) for _, sym in ipairs(Data.twoLetterSymbols) do if str:sub(i, i + #sym - 1) == sym then return...
Click to read more »NVR North Bay NNR NYMR Peak Perrygrove P&BR R&ER RH&DR RDR RH&WR SVR SMR STR Spa Valley SR Swanage S&CR Talyllyn VOR WL Weardale W&WLR WHR WHHR VOR WR...
Click to read more »errors = {} for _, dateStr in pairs( frame.args ) do dateStr = mw.text.trim(dateStr) if (string.lower(dateStr) == "until") then ...
Click to read more »Disparate: %s]], strMap(Set.valueIntersection(baseParams, otherParams), function(v) return string.format('* %s\n', v) end), strMap(Set...
Click to read more »of endorsers; both are required return string.format (cfg.heading_fmt_str, cfg.paragraph_open, args_t[1], args_t[2]); -- return formatted endorsements...
Click to read more »unmodified. str may be a comma- or semicolon-separated list ]] local function hyphen_to_dash( str ) if not utilities.is_set (str) then return str; end...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »unmodified. str may be a comma- or semicolon-separated list ]] local function hyphen_to_dash( str ) if not utilities.is_set (str) then return str; end...
Click to read more »table to HTML table local function jsonToHtmlTable(jsonStr) local jsonTable = cjson.decode(jsonStr) local html = "<table border='1'>\n" -- Function...
Click to read more »SensitiveEntity:matchesIPOrRange(str) -- Returns true, matchObj, queryObj if there is a match for the IP address -- string or CIDR range str in the sensitive entity...
Click to read more »add_diff_highlighting(str) if mw.ustring.find(str, "%s") then return '<span style="background-color: var(--wikt-palette-red-4,pink);">' .. string.gsub(str, " ",...
Click to read more »then local op_str = stylecc:match('^([^_]*)_[^_]*_[^_]*') local operands = {} operands[1] = stylecc:match(op_str..'_([^_]*)_[^_]*') operands[2]...
Click to read more »''):gsub('%s+', ' '):gsub('^%l', string.upper) end local compareStr if usedAutoFill then compareStr = normalizeTitle(firstLink) else local raw = (options...
Click to read more »local p = {} p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »["_default"] = { ["title"] = "[[%1]]", ["color"] = "009999" }, ["SkjStr"] = { ["title"] = "[[Skjern, Denmark|Skjern]]–[[Struer, Denmark|Struer]]"...
Click to read more »local p = {} local function numberToBinStr(x) ret="" while x~=1 and x~=0 do ret=tostring(x%2)..ret x=math.modf(x/2) end ret=tostring(x)..ret...
Click to read more »convert_dms2dec(direction, degrees_str, minutes_str, seconds_str) local degrees = tonumber(degrees_str) local minutes = tonumber(minutes_str) or 0 local seconds...
Click to read more »Wikipedia local p = {} p.Hi = function(frame) strName = frame.args.name return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »markdown(str) -- Bold & italic tags. str = str:gsub('%*%*%*([^\n*]+)%*%*%*', '<b><i>%1</i></b>') str = str:gsub('%*%*([^\n*]+)%*%*', '<b>%1</b>') str =...
Click to read more »function p.sums() local function add_days_to_date(date_str, days) local y, m, d = date_str:match("(%d+)%-(%d+)%-(%d+)") local ts = os.time{ year...
Click to read more »the #invoke command. p.main = function(frame) str = p.getMapframeString() return frame:preprocess(str) -- the mapframe needs to be preprocessed!!!...
Click to read more »str = "Hello World! test123" --Declare a local variable and set it equal to --"Hello World!". return str ...
Click to read more »same name needs to be referred to when the module is used. local str = "Hello World!" --Declare a local variable and set it equal to ...
Click to read more »"Hello, world!" end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »return "Hello, world!" end p.Hi = function(frame) strName = frame.args.name return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »local str = "Hello World!" --Declare a local variable and set it equal to --"Hello World!". return str --This...
Click to read more »p.hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to " .. strName .. ".<br>" end return p...
Click to read more »"hello" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »local p = {} p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.hello(...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »str, engine, host_data, frame_args, is_chapter) page_str = mw.ustring.gsub(page_str, ";", ",") local segments = mw.text.split(page_str, ",")...
Click to read more »= require('Module:DartsOrakel/data/Players'); end local function noAc(str) local tableAccents = {} tableAccents["À"] = "A" tableAccents["Á"]...
Click to read more »tidyCss(str) -- trims quotation marks str = mw.ustring.gsub(str, '^["\']*(.-)["\']*$', "%1") -- appends ";" if missing if mw.ustring.sub(str, -1)...
Click to read more »or lastchar == '.' or firstchar == '[' -- für Zusätze der Art "[s.str. prov.]", siehe https://www.infoflora.ch/de/flora/leucanthemopsis-alpina-sstr-prov...
Click to read more »-- Helper function to escape HTML tags local function escapeHtml(str) return str :gsub("&", "&") :gsub("<", "<") :gsub(">"...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »"Hello, world!" end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »last three chars of str are sepc'' str = f.sub(str, 1, -4) .. "''"; -- remove them and add back '' elseif f.sub(str, -5, -1) == duplicate_char...
Click to read more »"Hello, world!" end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »World!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »#string formatStr The string the be substituted -- @param #table args The arguments passed to this module local function subst(formatStr, args) --- --...
Click to read more »ustring.match(content, '%{%{(.*)%}%}') for str in mw.text.gsplit(temp, '|') do local pair = mw.text.split(str, '=') if #pair==2 then args[mw.text...
Click to read more »end end local attr_str = (#parts > 0) and (table.concat(parts, " ") .. " |") or "|" table.insert(out, attr_str .. " " .. (cell.text or ""))...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »tonumber(m)) local date_str = y .. '-' .. m .. '-' .. d local success, result = pcall(lang.formatDate, lang, 'F j, Y', date_str) return success and...
Click to read more »convert_dms2dec(direction, degrees_str, minutes_str, seconds_str) local degrees = tonumber(degrees_str) local minutes = tonumber(minutes_str) or 0 local seconds...
Click to read more »newFromIPv6(ipStr) -- Return a RawIP object if ipStr is a valid IPv6 string. Otherwise, -- return nil. ipStr = ipStr:match('^%s*(.-)%s*$') local _, n = ipStr:gsub(':'...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »normalise(str) return mw.ustring.gsub(str,"[" .. conf.WordSeparator .. "]+"," ") end local function tidyCss(str) str = mw.ustring.gsub(str, '^[\"\']*(...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »"JMSP" end p.Hi = function(frame) strName = frame.args.name or "Dave" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »collapse_orthologs) local localSeparatorStr = config.localSeparatorStr local localNotApplicableStr = config.localNotApplicableStr local rowBGcolor = config.rowBGcolor...
Click to read more »collapse_orthologs) local localSeparatorStr = config.localSeparatorStr local localNotApplicableStr = config.localNotApplicableStr local rowBGcolor = config.rowBGcolor...
Click to read more »escape a string for use in regexes function Excerpt.escapeString( str ) return str:gsub( '[%^%$%(%)%.%[%]%*%+%-%?%%]', '%%%0' ) end -- Helper method...
Click to read more »require "Module:SimpleDebug" local I18n = 'ChartColors' local function I18nStr (S, ...) return TNTT.GetMsgP (I18n, S, {...}) end --local RS_ColorNameInvalid...
Click to read more »attached i, j = dateStr:find("[T/]") if i then dateStr = dateStr:sub(1, i-1) end local from = 1 if dateStr:sub(1,1) == "-" then...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »length of the string as a single byte. def length_and_string(str) [str.length].pack('C') << str end # +search_fields+ should be a hash. It may be an empty...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »voice } for _, str in pairs(inSeq) do str = string.gsub(str, S, " ") str = string.gsub(str, "^ *", "") str = string.gsub(str, " *$", "") local...
Click to read more »localSeparatorStr = "," -- **lclz** Correct it if your wiki has different setting, like zhwiki uses "、" for now local localNotApplicableStr = "n/a" -- **lclz**...
Click to read more »Q_DNS then timeStr = 'DNS' end if endCause == Q_DNF then timeStr = 'DNF' end if endCause == Q_DQ then timeStr = 'DQ' end ...
Click to read more »attached i, j = dateStr:find("[T/]") if i then dateStr = dateStr:sub(1, i-1) end local from = 1 if dateStr:sub(1,1) == "-" then...
Click to read more »end p.Hi = function(frame) strName = frame.args.name or "RexxS" return "Hello from Lua to my friend <strong>" .. strName .. "</strong>.<br>" end return...
Click to read more »remove_container (str) local count; str, count = str:gsub( "<([^>]*)>", function(l) return l:gsub("^%s*(.-)%s*$", ""); end); return str, 0 < count...
Click to read more »world' end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br/>" end function p.temperature(frame)...
Click to read more »journalStr = journalStr .. " (" .. cite.issue .. ")" end if cite.pages then journalStr = journalStr .. ": pp...
Click to read more »table.sort (out); -- sort in language name order local key_str = table.concat ({ '--[[--------------------------< I S O _ 6 3 9 _ N A...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.temperature...
Click to read more »'/Julian' attached i, j = dateStr:find("[T/]") if i then dateStr = dateStr:sub(1, i-1) end local from = 1 if dateStr:sub(1,1) == "-" then -- this...
Click to read more »Q_DNS then timeStr = 'DNS' end if endCause == Q_DNF then timeStr = 'DNF' end if endCause == Q_DQ then timeStr = 'DQ' end ...
Click to read more »$2" --local Color = "Color" --local Legend = "legend" local function I18nStr (S, ...) return TNTT.GetMsgP (I18n, S, {...}) end function p.ColorNameInvFromS0...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end -- Task 03 p.temperature...
Click to read more »return msg end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end return p...
Click to read more »return "Meow" end p.Hi = function(frame) strName = frame.args.name or "default name" return "Hi there " .. strName .. ".<hr>" end p.Temperature = function(frame)...
Click to read more »= tostring(elem) end end local str = '{' .. table.concat(string_elems, ', ') .. '}' return str end, len = function (self) return TableTools...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function...
Click to read more »metaStr = metaStr .. ", " .. entry.importance .. " importance" end -- Cap it: ) metaStr = metaStr .. ")" ...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.converttemp(...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.converttemp...
Click to read more »world!" end function p.Hi(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »5=true} local function numberFlags(str) if not str then return {} end local flags = {} local ranges = mw.text.split(str, ",") -- parse ranges: "1,3-5"...
Click to read more »trim(args[1]) local pron = 'a' local ret = '' if s and s ~= '' then local origStr = s s = mw.ustring.gsub(s, '</?[A-Za-z][^>]->', '') -- Remove HTML tags...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.temperature(frame)...
Click to read more »<br>" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end -- Ttonyxx Google...
Click to read more »metaStr = metaStr .. ", " .. entry.importance .. " importance" end -- Cap it: ) metaStr = metaStr .. ")" ...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end function p.converttemp(frame)...
Click to read more »paragraph_open = paragraph_open, -- paragraph tag with styling heading_fmt_str = '%s<b>%s</b></p>\n%s', -- %s is paragraph_open, heading, endorsement...
Click to read more »'/Julian' attached i, j = dateStr:find("[T/]") if i then dateStr = dateStr:sub(1, i-1) end local from = 1 if dateStr:sub(1,1) == "-" then -- this...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end p.Temperature...
Click to read more »characters. ]] local function is_valid_isxn (isxn_str, len) local temp = 0; isxn_str = { isxn_str:byte(1, len) }; -- make a table of byte values...
Click to read more »percentStr = mw.ustring.format( '%d', percent ) if percent == 0 and supports == 0 and opposes == 0 and neutrals == 0 then percentStr = 'N/A'...
Click to read more »DEFAULT_RADIUS = 2 local function normalizeKey(str) if not str then return nil end str = tostring(str):lower() :gsub("^%s+", "") :gsub("%s+$"...
Click to read more »" end p.Hi = function( frame ) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end -- Lua Task 3...
Click to read more »require "Module:SimpleDebug" local I18n = 'ChartColors' local function I18nStr (S, ...) return TNTT.GetMsgP (I18n, S, {...}) end --local RS_ColorNameInvalid...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimmy" return "Hello from Lua to my friend " .. strName .. ".<br>" end --Lua Task 3 -...
Click to read more »local p = {} function p.stack(str, vertAlign, noBold) local t = {} local breakPattern = "<[bB][rR] */? *>" local function splitLines(line) table...
Click to read more »upper):gsub('^[lL]ist%sof%s+', '') end local compareStr if usedAutoFill then compareStr = normalizeTitle(firstLink) else local raw = (options...
Click to read more »is task 2 p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end --below this is...
Click to read more »world!" end p.Hi = function(frame) strName = frame.args.name or "Jimbo" return "Hello from Lua to my friend " .. strName .. ".<br>" end -- Task 3 p.temperature=...
Click to read more »getArgs(frame) local rgbStr = args[1] or error("RGB not specified", 1) rgbStr = mw.text.trim(rgbStr) local rgb = mw.text.split(rgbStr, ",") rgb[1] = tonumber(rgb[1])...
Click to read more »nil then sep = "%s" end local t = {} for str in string.gmatch(s, "([^"..sep.."]+)") do t[#t+1] = str:gsub("^%s+", ""):gsub("%s+$", "") end return...
Click to read more »