lib/amp/support/support.rb
##
# Pops the given character off the front of the string, but only if
# the string starts with the given character. Otherwise, nothing happens.
# Often used to remove troublesome leading slashes. Much like an "lchomp" method.
#
# @param [String] char the character to remove from the front of the string
# @return [String] the string with the leading +char+ removed (if it is there).
Pops the given character off the front of the string, but only if
the string starts with the given character. Otherwise, nothing happens.
Often used to remove troublesome leading slashes. Much like an "lchomp" method.
Pops the given character off the front of the string but only if the string starts with the given character . Otherwise nothing happens . Often used to remove troublesome leading slashes . Much like an " lchomp " method .
def shift(char)
    return '' if self.empty?
    return self[1..-1] if self.start_with? char
    self
  end
def shift ( char ) return '' if self . empty? return self [ 1 .. - 1 ] if self . start_with? char self end
Pops the given character off the front of the string, but only if
the string starts with the given character.
Pops the given character off the front of the string but only if the string starts with the given character .
the string with the leading +char+ removed (if it is there).
the string with the leading + char + removed ( if it is there ) .
String
char
<not_specific>
<not_specific>
char the character to remove from the front of the string
char the character to remove from the front of the string