Method: String#at
- Defined in:
- lib/ruby/jruby_hack.rb
#at(n) ⇒ String
Return the one-character string at the given index
443 444 445 446 |
# File 'lib/ruby/jruby_hack.rb', line 443 def at(n) raise ArgumentError, "n must be positive" if n < 0 self[n, 1] unless n >= length end |