I have an array of banned words in Ruby:
bw = ["test"]
I want to check @nick against it.
For example
@nick = 'justatest'
would match.
I have tried:
if @nick.include?(bw)
##
end
but that doesn't seem to be the right way to do it as it doesn't catch it.
if bw.any? { |word| @nick =~ /#{word}/}should work. Example