Module:String2: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(function stripZeros) |
(suppress second value from gsub()) |
||
Line 89: | Line 89: | ||
local s = mw.text.trim(frame.args[1] or "") |
local s = mw.text.trim(frame.args[1] or "") |
||
n = tonumber( string.match( s, "%d+" ) ) or "" |
n = tonumber( string.match( s, "%d+" ) ) or "" |
||
s = string.gsub( s, "%d+", n, 1 ) |
|||
return s |
|||
end |
end |
||