Method: String#take
- Defined in:
- lib/ruby/jruby_hack.rb
#take(n) ⇒ String
Return the first n characters from the front
471 472 473 474 |
# File 'lib/ruby/jruby_hack.rb', line 471 def take(n) raise ArgumentError, "n must be positive" if n < 0 self[0, n] end |