From b2e9d33515eb858507cfab8e15eb4a9e049a433a Mon Sep 17 00:00:00 2001 From: Francesco Rodriguez Date: Fri, 11 May 2012 12:56:53 -0500 Subject: improve String#first docs --- activesupport/lib/active_support/core_ext/string/access.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/core_ext/string/access.rb b/activesupport/lib/active_support/core_ext/string/access.rb index 9bb0c597b2..baa5b84db6 100644 --- a/activesupport/lib/active_support/core_ext/string/access.rb +++ b/activesupport/lib/active_support/core_ext/string/access.rb @@ -64,10 +64,9 @@ class String self[0..position] end - # Returns the first character of the string. If a limit is supplied, - # returns a substring from the beginning of the string to the given - # limit. If the given limit is greater than or equal to the string - # length, returns self. + # Returns the first character. If a limit is supplied, returns a substring + # from the beginning of the string until it reaches the limit value. If the + # given limit is greater than or equal to the string length, returns self. # # str = "hello" # str.first #=> "h" -- cgit v1.2.3