c++ string to vector using delimiter

#include <iostream>
#include <vector>
#include <string>
#include <sstream>

int main() {
    std::string inputString = "Hello,World,This,Is,C++,String,To,Vector,Example";
    std::vector<std::string> resultVector;

    std::istringstream inputStream(inputString);
    std::string token;

    while (std::getline(inputStream, token, ',')) {
        resultVector.push_back(token);
    }

    // Display the elements of the resulting vector
    std::cout << "Resulting Vector Elements:" << std::endl;
    for (const auto& element : resultVector) {
        std::cout << element << std::endl;
    }

    return 0;
}