From: Rob Biedenharn Date: 2010-08-03T06:54:34+09:00 Subject: Re: How to remove leading   from string On Aug 2, 2010, at 5:15 PM, BruceL wrote: > On Aug 2, 3:59 am, Lucky Nl wrote: >> Hi >> I Need small help that how to remove leading   tags >> My text is: >> str = "

Welcome to ruby   

  

" >> I want result is >> str = "

Welcome to ruby

" >> >> Can anybody help >> -- >> Posted viahttp://www.ruby-forum.com/. > > simply a.delete!(" ") > Well, that's almost certainly not what the OP wants! irb> str = "

Welcome to ruby   

  

" => "

Welcome to ruby   

  

" irb> str.delete(' ') => "<>Welcome to ruy <>" Look at the documentation for String#delete Then take a look at String#gsub I suspect that you want to do two passes: one for ' ' and one for empty paragraphs. -Rob Rob Biedenharn Rob@AgileConsultingLLC.com http://AgileConsultingLLC.com/ rab@GaslightSoftware.com http://GaslightSoftware.com/