יחידה:String: הבדלים בין גרסאות בדף
Add "rep" function per request by User:קיפודנחש at Wikipedia:Lua requests#Template:Loop and Template:Loop15. Copied from sandbox. |
הוספת "reverse" |
||
| שורה 383: | שורה 383: | ||
end | end | ||
--[[ | --[[ | ||
"Reverse" reverses a string, a'la string.reverse() | |||
]] | ]] | ||
str.reverse = function( frame ) | |||
local tab = mw.text.split( frame.args[1] or '', '' ) | |||
local restab = {} | |||
for i = #tab, 1 do table.insert( restab, tab[i] ) end | |||
return table.concat( restab ) | |||
end | |||
str['היפוך'] = str.reverse | |||
--[[ | --[[ | ||