Call each on a string with escape sequence : each « String « Ruby






Call each on a string with escape sequence


"foo\nbar".each { |x| puts x }
# foo
# bar

 

Related examples in the same category

1.returning the length of each word