output = input.gsub(/^#/, "")



On Tuesday, 16 October 2012 at 6:27 PM, ӧѧ ڧ֧ӧѧ wrote:

> Simplest method is to use Regex.
>  
> 2012/10/16 ajay paswan <lists / ruby-forum.com (mailto:lists / ruby-forum.com)>
> > What is the most efficient way to drop '#' from the first place andlast
> > 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/.
>