Sha256: bcbaa42da4f6e788d8b324a21820b0e3ab9dee122ea58b0ab97b422515adcdb8

Contents?: true

Size: 302 Bytes

Versions: 1

Compression:

Stored size: 302 Bytes

Contents

require 'nano/string/last_char'

class String
  # Returns first _n_ characters.
  #
  #   "Hello World".first_char(3)  #=> "Hel"
  #
  def first_char(n=1)
    slice(0, n.to_i)
  end
end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# TODO

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-0.9.0 lib/nano/string/first_char.rb