added examples to String#exclude?

This commit is contained in:
Francesco Rodriguez 2012-05-11 16:42:23 -05:00
parent ef440bb0c3
commit 7bf6edf819

@ -1,5 +1,10 @@
class String
# The inverse of <tt>String#include?</tt>. Returns true if the string does not include the other string.
# The inverse of <tt>String#include?</tt>. Returns true if the string
# does not include the other string.
#
# "hello".exclude? "lo" #=> false
# "hello".exclude? "ol" #=> true
# "hello".exclude? ?h #=> false
def exclude?(string)
!include?(string)
end