יחידה:String: הבדלים בין גרסאות בדף

מ 45 גרסאות של הדף wikipedia:he:יחידה:String יובאו
ניסוי
שורה 543: שורה 543:


str["קידוד"] = str.encode
str["קידוד"] = str.encode
str['מיצוי מספר'] = function(frame)
local s = frame.args[1]
local def = frame.args[2] or ''
if not s then return def end
local int, frac = s:match('[^%d.]*([%d,]*)(%.%d+)')
if int or frac then
int = string.gsub(int or '', ',', '') -- remove commas
frac = frac or ''
return int .. frac
else
return def
end
end


return str
return str