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 ...@@ -94,16 +94,17 @@ class String
(s == self) ? nil : self.replace(s) (s == self) ? nil : self.replace(s)
end end
# call-seq: ##
# str.casecmp(other_str) -> -1, 0, +1 or nil # call-seq:
# # str.casecmp(other_str) -> -1, 0, +1 or nil
# Case-insensitive version of <code>String#<=></code>. #
# # Case-insensitive version of <code>String#<=></code>.
# "abcdef".casecmp("abcde") #=> 1 #
# "aBcDeF".casecmp("abcdef") #=> 0 # "abcdef".casecmp("abcde") #=> 1
# "abcdef".casecmp("abcdefg") #=> -1 # "aBcDeF".casecmp("abcdef") #=> 0
# "abcdef".casecmp("ABCDEF") #=> 0 # "abcdef".casecmp("abcdefg") #=> -1
# # "abcdef".casecmp("ABCDEF") #=> 0
#
def casecmp(str) def casecmp(str)
self.downcase <=> str.to_str.downcase self.downcase <=> str.to_str.downcase
rescue NoMethodError 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