Can you specify what ISN'T a delimiter in std::getline?
问题 I want it to consider anything that isn't an alphabet character to be a delimiter. How can I do this? 回答1: You can't. The default delimiter is \n : while (std::getline (std::cin, str) // '\n' is implicit For other delimiters, pass them: while (std::getline (std::cin, str, ' ') // splits at a single whitespace However, the delimiter is of type char, thus you can only use one "split-character", but not what not to match. If your input already happens to be inside a container like std::string ,