Modul:Str: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
te>Antonsusi K |
te>Antonsusi K |
||
Zeile 20: | Zeile 20: | ||
return mw.ustring.sub(frame.args[1],1*frame.args[2],e) | return mw.ustring.sub(frame.args[1],1*frame.args[2],e) | ||
end | end | ||
− | return Str | + | |
+ | 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,l-n) | ||
+ | end | ||
+ | |||
+ | return Str |
Version vom 8. Mai 2013, 11:17 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,l-n) end
return Str