Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:AeroWikiListTools: Difference between revisions

From Aeronautica Official Wiki
Sqwishyish (talk | contribs)
Created string splitting module
 
Sqwishyish (talk | contribs)
m debugging split_list function
Line 3: Line 3:
p.split_list = function (input_string, template)
p.split_list = function (input_string, template)
     local new_string = ''
     local new_string = ''
    mw.log(split)
     for split in string.gmatch(input_string, '([^, ]+)') do
     for split in string.gmatch(input_string, '([^, ]+)') do
         new_string = new_string .. template:gsub('{split}', split) .. ', '
         new_string = new_string .. template:gsub('{split}', split) .. ', '

Revision as of 06:44, 29 April 2025

Documentation for this module may be created at Module:AeroWikiListTools/doc

local p = {}

p.split_list = function (input_string, template)
    local new_string = ''
    mw.log(split)
    for split in string.gmatch(input_string, '([^, ]+)') do
        new_string = new_string .. template:gsub('{split}', split) .. ', '
    end
    return new_string:sub(1, -3)
end
return p
Cookies help us deliver our services. By using our services, you agree to our use of cookies.