Two different versions of a splitting function are listed as follows:
- The first one uses a single character as the delimiter. To split the input string it uses a string stream initialized with the content of the input string, using std::getline() to read chunks from it until the next delimiter or an end-of-line character is encountered.
- The second one uses a list of possible character delimiters, specified in an std::string. It uses std:string::find_first_of() to locate the first position of any of the delimiter characters, starting from a given position. It does so in a loop until the entire input string is being processed. The extracted substrings are added to the result ...