split string at \n ans convert in to array Ruby code example Example: ruby string to array "a b c d".split(" ")