Heya On Jan 23, 2008 6:49 PM, JacobC2 <jacobc2 / gmail.com> wrote: > I am writing a program that reads a text file and then dumps it into a > mysql database, the problem that I am having is that the array has > illegal characters in it so I need to do an escape_string or something > on it. but how could I do this on an array? > You can use map! or collect! or their non-destructive brothers map and collect. collect/map apply a method to each element in the array and return a new array with the results. # lines is some array escaped = lines.map { |element| some_mysql_escape(element) }