From: w_a_x_man Date: 2010-10-04T23:12:42+09:00 Subject: Re: save only first line from string? On Oct 3, 9:19 pm, Terry Michaels wrote: > Hi. What's the most simple and elegant way to remove all the contents of > a String except for the first line? (Assume string consist of one line, > multiple lines, or no lines, and assume that we don't know which OS we > are on.) > -- > Posted viahttp://www.ruby-forum.com/. "a string\nwith multiple\nlines"[ /.*/ ] ==>"a string"