From: Josh Vaughn Date: 2011-08-13T00:10:39+09:00 Subject: Re: parsing xml string into seprate line of string --0-1801061557-1313161836=:58863 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello,=0A=0ASry I forgot to add the each on the end=0A=0APlease try this fo= llowing instead=0Astr =3D "<note>\n<to>Tove</to>= \n<from>Jani</from>\n<heading>Reminder</headin= g>\n<body>Don't forget me this weekend!</body>\n= </note>"=0Astr.each_line.each { |s| print s.strip }=0A=0AI simpl= y use the each_line to get and enumerator then call the each method on that= . Then inside the block make sure to strip the '/n' of course you c= an do as you wish inside the block.=0A=0AThanks=0AJosh=0A=0A=0A>________= ________________________=0A>From: saurabh a. <saurabh_anand2002@yahoo= .com>=0A>To: ruby-talk ML <ruby-talk@ruby-lang.org>=0A>Sent:= Thursday, August 11, 2011 1:48 PM=0A>Subject: parsing xml string into s= eprate line of string=0A>=0A>HI,=0A>=0A>Thanks for the help.=0A= >=0A>i have a xml and want to parse it line by line. suppose i have= =0A>abc =3D "<a1>=0A>=A0 =A0 =A0 <a2>123</a2>= =0A>=A0 =A0 =A0 <a3>123</a2>=0A>=A0 =A0 =A0 <a4>1= 23</a2>=0A>=A0 =A0 =A0 <a5>123</a2>=0A>=A0 =A0 =A0= </a1>"=0A>=0A>and i want to parse it line by line. there= could be any number of line.=0A>my output should be seperate string lik= e=0A>"<a1>"=0A>"<a2>123</a2>"= =0A>"<a3>123</a3>"=0A>"<a4>123</a= 4>"=0A>"<a5>123</a2>"=0A>"</a1&= gt;"=0A>=0A>how can i acheive this one using any string function= or regular=0A>expression.=0A>=0A>Please help.=0A>=0A>Thanks= =0A>Saurabh=0A>=0A>-- =0A>Posted via http://www.ruby-forum.com/= .=0A>=0A>=0A>=0A> --0-1801061557-1313161836=:58863--