Permalink
Browse files

AS guide: documents String#at

  • Loading branch information...
1 parent b1cdd97 commit b1409799f8b8cb355b71493d0724dc158aac9bec @fxn fxn committed Sep 22, 2009
Showing with 13 additions and 0 deletions.
  1. +13 −0 railties/guides/source/active_support_overview.textile
@@ -737,6 +737,19 @@ Ruby 1.8.7 and up define the iterator +String#each_char+ that understands UTF8 a
"\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E".each_char {|c| print c} # => 日本語
</ruby>
+h4. Access
+
+h5. +at(position)+
+
+Returns the character of the string at position +position+:
+
+<ruby>
+"hello".at(0) # => "h"
+"hello".at(4) # => "o"
+"hello".at(-1) # => "o"
+"hello".at(10) # => nil
+</ruby>
+
h3. Extensions to +Numeric+
...

0 comments on commit b140979

Please sign in to comment.