The string classes also provide a special convenience function std::getline() for reading line by line: This function reads all characters, including leading whitespaces, until the line delimiter or end-of-file is reached. The line delimiter is extracted but not appended. By default, the line delimiter is the newline character, but you can pass your own “line” delimiter as an optional argument.8 This way, you can read token by token, separated by any arbitrary character: