+ 1
Finding keywords in user input?
I'm looking to see if there is a way to find certain keywords in user input, such as "look" in the input "look around."
1 Resposta
+ 1
I don't know Ruby, but have you considered splitting the input into individual words and iterating thru them looking for specific keywords?
yourString = "hey you, look over here"
yourString=yourString.split(' ')
yourString.each { |x| puts "looked" if x == "look"}