Modul:Str: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
te>Antonsusi K |
te>Antonsusi K |
||
Zeile 25: | Zeile 25: | ||
n=1*frame.args[2] | n=1*frame.args[2] | ||
l = 1 * mw.ustring.len(s) | l = 1 * mw.ustring.len(s) | ||
− | return mw.ustring.sub(s,1,l | + | return mw.ustring.sub(s,1,n-l) |
end | end | ||
return Str | return Str |
Version vom 8. Mai 2013, 11:29 Uhr
local Str = {} function Str.len(frame) return mw.ustring.len(frame.args[1]) end
function Str.left(frame) return mw.ustring.sub(frame.args[1],1,1*frame.args[2]) end
function Str.right(frame) return mw.ustring.sub(frame.args[1],-1 * frame.args[2],-1) end
function Str.index(frame) return mw.ustring.sub(frame.args[1],1*frame.args[2],1*frame.args[2]) end
function Str.sub(frame) e=frame.args[2]+frame.args[3]-1 return mw.ustring.sub(frame.args[1],1*frame.args[2],e) end
function Str.crop(frame) s= frame.args[1] n=1*frame.args[2] l = 1 * mw.ustring.len(s) return mw.ustring.sub(s,1,n-l) end
return Str