How do you accept case-insensitive and allow embedded blanks in a user input? So the user can enter “hong konG” and get a correct match to the input.
I only have the input[0] = toupper(input[0]); which only accepts if the case sensitive is at the beginning of the word.
while(true){ cout << "Enter a city by name: "<< " "; std::getline (std::cin,input); if (input == "quit") { break; } input[0] = toupper (input[0]); //....how do I loop to find all letter's in the input string variable? }
std::transform.beginandendcalls to use.