Skip to content
This repository
Browse code

improve String#first docs

  • Loading branch information...
commit b2e9d33515eb858507cfab8e15eb4a9e049a433a 1 parent 074359d
Francesco Rodríguez frodsan authored
7 activesupport/lib/active_support/core_ext/string/access.rb
@@ -64,10 +64,9 @@ def to(position)
64 64 self[0..position]
65 65 end
66 66
67   - # Returns the first character of the string. If a limit is supplied,
68   - # returns a substring from the beginning of the string to the given
69   - # limit. If the given limit is greater than or equal to the string
70   - # length, returns self.
  67 + # Returns the first character. If a limit is supplied, returns a substring
  68 + # from the beginning of the string until it reaches the limit value. If the
  69 + # given limit is greater than or equal to the string length, returns self.
71 70 #
72 71 # str = "hello"
73 72 # str.first #=> "h"

0 comments on commit b2e9d33

Please sign in to comment.
Something went wrong with that request. Please try again.