added examples to String#exclude?
This commit is contained in:
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
|
||||
|
Loading…
Reference in New Issue
Block a user