aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/access.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/string/access.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/string/access.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/string/access.rb b/activesupport/lib/active_support/core_ext/string/access.rb
index 182b3e745d..64bc8f6cea 100644
--- a/activesupport/lib/active_support/core_ext/string/access.rb
+++ b/activesupport/lib/active_support/core_ext/string/access.rb
@@ -7,7 +7,7 @@ class String
# Examples:
# "hello".at(0) # => "h"
# "hello".at(4) # => "o"
- # "hello".at(10) # => nil
+ # "hello".at(10) # => ERROR if < 1.9, nil in 1.9
def at(position)
mb_chars[position, 1].to_s
end
@@ -17,7 +17,7 @@ class String
# Examples:
# "hello".from(0) # => "hello"
# "hello".from(2) # => "llo"
- # "hello".from(10) # => nil
+ # "hello".from(10) # => "" if < 1.9, nil in 1.9
def from(position)
mb_chars[position..-1].to_s
end