diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-06-03 16:34:21 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-06-03 16:34:21 +0900 |
| commit | 427ea605e7408fd2ed3b5c97d701c660b8028788 (patch) | |
| tree | 1914f4d72a56d6ba8969879d3bfcadb1bbb71907 /mrbgems/mruby-string-ext | |
| parent | b81f0d0ffb7db46507f7b79ccb72cc94428555ce (diff) | |
| parent | 037a1d70880ecdcfd2d55eb10c234de1001eb654 (diff) | |
| download | mruby-427ea605e7408fd2ed3b5c97d701c660b8028788.tar.gz mruby-427ea605e7408fd2ed3b5c97d701c660b8028788.zip | |
Merge branch 'master' of github.com:mruby/mruby
Diffstat (limited to 'mrbgems/mruby-string-ext')
| -rw-r--r-- | mrbgems/mruby-string-ext/mrblib/string.rb | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/mrbgems/mruby-string-ext/mrblib/string.rb b/mrbgems/mruby-string-ext/mrblib/string.rb index 18a7a62d3..a08fc0f46 100644 --- a/mrbgems/mruby-string-ext/mrblib/string.rb +++ b/mrbgems/mruby-string-ext/mrblib/string.rb @@ -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 |
