aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/string/exclude.rb
blob: 114bcb87f078d93cbc29878be994709daa21af46 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
class 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
end