class String

Public Instance Methods

first(n = 1) click to toggle source
# File lib/getth.rb, line 16
def first(n = 1)
  self[0...n]
end
last(n = 1) click to toggle source
# File lib/getth.rb, line 20
def last(n = 1)
  n > self.size ? self : self[-n..-1]
end