Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/mpm.rb

Overview


->CLASS->STRING ——————————–


headynation.com/opposite-of-chomp-in-ruby/

Instance Method Summary collapse

Instance Method Details

#remove_from_beginning(string_to_remove) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/mpm.rb', line 31

def remove_from_beginning(string_to_remove)
  len = string_to_remove.size
  if self[0..(len-1)] == string_to_remove
    return self[len..-1]
  end
  self
end