Everything seems to be working fine except the commented line:
#return false if not s[0].upcase =~ /AZ/
and the fourth check.
What is the correct if
statement for s[0]
and /AZ/
comparison?
def starts_with_consonant?(s)
return false if s.length == 0
#return false if not s[0].upcase =~ /AZ/
n = "AEIOU"
m = s[0]
return true if not n.include? m.upcase
false
end
puts starts_with_consonant?("Artyom") # false 1
puts starts_with_consonant?("rtyom") # true 2
puts starts_with_consonant?("artyom") # false 3
puts starts_with_consonant?("$rtyom") # false 4
puts starts_with_consonant?("") # false 5