From: Arlen Cuss Date: 2012-10-16T16:28:35+09:00 Subject: Re: Drop 1st and last particular character output = input.gsub(/^#/, "") On Tuesday, 16 October 2012 at 6:27 PM, Иван Бишевац wrote: > Simplest method is to use Regex. > > 2012/10/16 ajay paswan > > What is the most efficient way to drop '#' from the first place and last > > place if any. > > > > for example: > > if input= #hithere# then output = hithere > > if input = hithere# then output =hithere > > if input = #hithere then output =hithere > > if input = hithere then output=hithere > > > > -- > > Posted via http://www.ruby-forum.com/. >