mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
14 lines
391 B
Ruby
14 lines
391 B
Ruby
# typed: strict
|
|
# frozen_string_literal: true
|
|
|
|
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
|
|
sig { params(string: String).returns(T::Boolean) }
|
|
def exclude?(string) = !include?(string)
|
|
end
|