Showing posts with label int array converion in rails. Show all posts
Showing posts with label int array converion in rails. 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]