Ruby 'gets' that works over multiple lines
Using the IRB, I want to enter a multiple line string in order to strip certain characters from it. "gets" only allows a single line - is there a similar function for multiple lines. ASCII_project.rb(main):002:0* puts = "What's the text you want to strip?" => "What's the text you want to strip?" ASCII_project.rb(main):003:0> str = gets I now want to paste in a section of text - because of the new lines it doesn't function. This is why I want to collect over multiple lines Here is the code # encoding: CP850 puts = "What's the text you want to strip?" str = gets str.gsub!(/\P{ASCII}/, '') puts