From: Brian Candler Date: 2010-08-02T21:30:46+09:00 Subject: Re: How to remove leading   from string Lucky Nl wrote: > Hi , > Am entering multiple paragrpahs in editior .that will be saved into str > varable. > > Ex: > str is >

test one   

  

test one test > onetest onetest one

test two test > two test two test two   

  

> > we have enetered like this way > I want result is > >

test one   

  

test one test > onetest onetest one

test two test > two test two test two

> > > here removed end of the nbsptags between paragparhs and removed nbsp; 's > in "

test two test > two test two test two

" Your requirement is unclear. Are you saying you want to remove the  's within the fourth paragraph only, and remove the fifth paragraph entirely? I've shown you how to use gsub, and where to find more documentation on it. String#scan might be useful too. I suggest you use them in whatever way you need, since only you understand what you're trying to achieve. -- Posted via http://www.ruby-forum.com/.