diff options
author | Xavier Noria <fxn@hashref.com> | 2009-09-22 09:57:55 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2009-09-22 23:09:30 +0200 |
commit | b1409799f8b8cb355b71493d0724dc158aac9bec (patch) | |
tree | 9785ad56e02ef840d8ecaa4f4a722f5062a334e6 /railties/guides | |
parent | b1cdd97ce53821729e4fa21977eb25bffe263a4e (diff) | |
download | rails-b1409799f8b8cb355b71493d0724dc158aac9bec.tar.gz rails-b1409799f8b8cb355b71493d0724dc158aac9bec.tar.bz2 rails-b1409799f8b8cb355b71493d0724dc158aac9bec.zip |
AS guide: documents String#at
Diffstat (limited to 'railties/guides')
-rw-r--r-- | railties/guides/source/active_support_overview.textile | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/railties/guides/source/active_support_overview.textile b/railties/guides/source/active_support_overview.textile index d8f6b31a65..ca4d952c10 100644 --- a/railties/guides/source/active_support_overview.textile +++ b/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+ ... |