Commit 896c1312 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2346 from suzukaze/add-string-comment2

Fix indent in String#casecmp comments
parents 6e94f9bb 85ed19ca
......@@ -94,16 +94,17 @@ class String
(s == self) ? nil : self.replace(s)
end
# call-seq:
# str.casecmp(other_str) -> -1, 0, +1 or nil
#
# Case-insensitive version of <code>String#<=></code>.
#
# "abcdef".casecmp("abcde") #=> 1
# "aBcDeF".casecmp("abcdef") #=> 0
# "abcdef".casecmp("abcdefg") #=> -1
# "abcdef".casecmp("ABCDEF") #=> 0
#
##
# call-seq:
# str.casecmp(other_str) -> -1, 0, +1 or nil
#
# Case-insensitive version of <code>String#<=></code>.
#
# "abcdef".casecmp("abcde") #=> 1
# "aBcDeF".casecmp("abcdef") #=> 0
# "abcdef".casecmp("abcdefg") #=> -1
# "abcdef".casecmp("ABCDEF") #=> 0
#
def casecmp(str)
self.downcase <=> str.to_str.downcase
rescue NoMethodError
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment