From: Cyril Joe Newsgroups: comp.lang.ruby Subject: newlines in array problem Date: Thu, 7 Apr 2011 11:38:08 -0500 Organization: Service de news de lacave.net Lines: 16 Message-ID: <030a5c75c68358523471052f22f04f7b@ruby-forum.com> NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1302194300 66216 65.111.164.187 (7 Apr 2011 16:38:20 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Thu, 7 Apr 2011 16:38:20 +0000 (UTC) X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 381134 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: <030a5c75c68358523471052f22f04f7b@ruby-forum.com> Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.stben.net!talisker.lacave.net!lacave.net!not-for-mail Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:2474 Is there a way to get rid of newlines in an array? Example: array = ["hel\nlo", "bl\nah"] I want the output to be new_array = ["hello", "blah"] I tried: array.each do |el| el.delete("\n") end But that didn't work. Can't figure this out. Any suggestions? -- Posted via http://www.ruby-forum.com/.