Jump to content

Module:Sandbox/Squc/Test

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Squc (talk | contribs) at 12:18, 12 August 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Testing module

local p={}

function p.test1 (frame)
    local input = frame.args[1]
    local find = frame.args["find"]
    local output = ""
    for i=1, #input do 
        output = (output..mw.ustring.sub(input, i, i)..",")
        if find and mw.ustring.sub(input,i,i) == find then output=(output.."[Found at "..i.."]") end
    end
    return output
end

return p