Showing posts with label string array to integer array ruby. Show all posts
Showing posts with label string array to integer array ruby. Show all posts

Saturday, July 31, 2010

Ruby string array converted into integer array


["1","2","3","4"].map(&:to_i) => [1, 2, 3, 4]
    OR
["1","2","3","4"].collect(&:to_i) => [1, 2, 3, 4]