[ create a new paste ] login | about

Link: http://codepad.org/ZFpqaY6T    [ raw code | output | fork ]

Ruby, pasted on Dec 6:
1
2
3
4
5
n = ["998700", "1001900", "009987", "0010019"]
puts n.map { |i|
    i =~ /^0*([0-9]+?)0*$/
    "00" + $1 + "0" * [0, 6 - $1.length].max
}


Output:
1
2
3
4
00998700
00100190
00998700
00100190


Create a new paste based on this one


Comments: