user_input = gets.chomp
user_input.downcase!
if user_input.include?('substring')
# Do something
end
This will help you check if the string contains substring or not
puts "Enter a string"
user_input = gets.chomp # Ex: Tommy
user_input.downcase! # tommy
if user_input.include?('s')
puts "Found"
else
puts "Not found"
end