Check out example codes for "tokenize string c++". It will help you in understanding the concepts better.

Code Example 1

//the program take input as string and delimiter is ','.
//delimiter can  be changed in line 9;

std::vector<std::string> tokenise(const std::string &str){
    std::vector<std::string> tokens;
    int first = 0;
        int second = str.find_first_of(',',first);
        //first has index of start of token
        //second has index of end of token + 1;
            second = str.size();
        std::string token = str.substr(first, second-first);
        first = second + 1;
    return tokens;

Learn ReactJs, React Native from