Skip to content
This repository
Newer
Older
100644 11 lines (11 sloc) 0.296 kb
19c48281 » jeremy
2009-12-27 String#exclude? core extension: inverse of #include?
1 class String
2f4696de » frodsan
2012-05-12 adding examples and docs
2 # The inverse of <tt>String#include?</tt>. Returns true if the string
3 # does not include the other string.
4 #
5 # "hello".exclude? "lo" #=> false
6 # "hello".exclude? "ol" #=> true
7 # "hello".exclude? ?h #=> false
19c48281 » jeremy
2009-12-27 String#exclude? core extension: inverse of #include?
8 def exclude?(string)
9 !include?(string)
10 end
11 end
Something went wrong with that request. Please try again.