Skip to content
Browse files

added examples to String#exclude?

  • Loading branch information...
1 parent ef440bb commit 7bf6edf819adf48b253dce7673ec82cda821646b Francesco Rodriguez committed May 11, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 activesupport/lib/active_support/core_ext/string/exclude.rb
View
7 activesupport/lib/active_support/core_ext/string/exclude.rb
@@ -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

0 comments on commit 7bf6edf

Please sign in to comment.
Something went wrong with that request. Please try again.