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

提供:WikiWiki
ナビゲーションに移動 検索に移動
編集の要約なし
編集の要約なし
1行目: 1行目:
local p = {}
function hundred(frame)
function p.hundred(frame)
    if frame[2] == true then
for i = 1,100 do
        if string.find(frame[1],frame[2]) == true then
mw.log(frame.args[1])
            a,b = string.find(frame[1],frame[2])
end
            m = string.char(string.byte(frame[1],a,b))
return mw.allToString()
            if a == 1 then
                n =""
            else
                n = string.char(string.byte(frame[1],1,a-1))
            end
            if b == #frame[1] then
                o=""
            else
                o = string.char(string.byte(frame[1],b+1,#frame[1]-1))
            end
            return n..m..o
        end
    end
end
end
return p

2年1月9日 (ゐ) 22:27時点における版

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

function hundred(frame)
    if frame[2] == true then
        if string.find(frame[1],frame[2]) == true then
            a,b = string.find(frame[1],frame[2])
            m = string.char(string.byte(frame[1],a,b))
            if a == 1 then
                n =""
            else 
                n = string.char(string.byte(frame[1],1,a-1))
            end
            if b == #frame[1] then
                o=""
            else
                o = string.char(string.byte(frame[1],b+1,#frame[1]-1))
            end
            return n..m..o
        end
    end
end