I\'m trying to get user input and check if the user put in \"y\" or \"n\". Surprisingly, in the below code, neither the if nor the if else case exe
if
if else
read_line includes the terminating newline in the returned string. Add .trim_right_matches("\r\n") to your definition of correct_name to remove the terminating newline.
read_line
.trim_right_matches("\r\n")
correct_name