Skip to content

Commit

Permalink
Correct (l|r)strip example [ci skip] (#3599)
Browse files Browse the repository at this point in the history
makenowjust authored and ysbaddaden committed Nov 28, 2016

Verified

This commit was signed with the committer’s verified signature.
headius Charles Oliver Nutter
1 parent 6117bed commit eff31e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/string.cr
Original file line number Diff line number Diff line change
@@ -1171,8 +1171,8 @@ class String
# Returns a new string with trailing whitespace removed.
#
# ```
# " hello ".strip # => " hello"
# "\tgoodbye\r\n".strip # => "\tgoodbye"
# " hello ".rstrip # => " hello"
# "\tgoodbye\r\n".rstrip # => "\tgoodbye"
# ```
def rstrip
excess_right = calc_excess_right
@@ -1187,8 +1187,8 @@ class String
# Returns a new string with leading whitespace removed.
#
# ```
# " hello ".strip # => "hello "
# "\tgoodbye\r\n".strip # => "goodbye\r\n"
# " hello ".lstrip # => "hello "
# "\tgoodbye\r\n".lstrip # => "goodbye\r\n"
# ```
def lstrip
excess_left = calc_excess_left

0 comments on commit eff31e5

Please sign in to comment.