From: Brian Candler Date: 2010-08-03T22:13:48+09:00 Subject: Re: How to remove leading   from string Lucky Nl wrote: > i want to remove spaces wt the endof the lastpargrpah also.Not in the 1 > &2&3rd pargrpahs > Want result is > str = "

pargraph1 pargraph1   

pargraph2 pargraph2 > pargraph2   

>

pargraph3 hello3 hell13   

>

pargraph4 hello4 hell14

So, write a regexp which matches any number of   or space, followed by

, followed by end of string. I've given you the tools to do that already. If you can't make it work then show what you tried, and we can explain what needs changing. You can test your regexps using irb, or you can use this web site: http://rubular.com/ -- Posted via http://www.ruby-forum.com/.