「モジュール:テスト」の版間の差分

提供:WikiWiki
ナビゲーションに移動 検索に移動
編集の要約なし
編集の要約なし
7行目: 7行目:
             n = a == 1 and "" or string.char(string.byte(frame.args[1],1,a-1))
             n = a == 1 and "" or string.char(string.byte(frame.args[1],1,a-1))
             o = b == #frame.args[1] and "" or string.char(string.byte(frame.args[1],b+1,#frame.args[1]-1))
             o = b == #frame.args[1] and "" or string.char(string.byte(frame.args[1],b+1,#frame.args[1]-1))
             return n..string.rep(m,100)..o or (n..string.rep(m,100) and string.rep(m,100)..o) or string.rep(m,100)
             return n
         else
         else
         local m = frame.args[1]
         local m = frame.args[1]

2年1月14日 (I) 00:02時点における版

このモジュールについての説明文ページを モジュール:テスト/doc に作成できます

local p = {}
function p.hundred(frame)
    if frame.args[2] then
        if string.find(frame.args[1],frame.args[2]) then
            local a,b = string.find(frame.args[1],frame.args[2])
            local m = string.char(string.byte(frame.args[1],a,b))
            n = a == 1 and "" or string.char(string.byte(frame.args[1],1,a-1))
            o = b == #frame.args[1] and "" or string.char(string.byte(frame.args[1],b+1,#frame.args[1]-1))
            return n
        else
        	local m = frame.args[1]
        	return string.rep(m,100)
        end
    else
    	local m = frame.args[1]
        	return string.rep(m,100)
    end
end
return p