Check out example codes for "split string on character vector C++". It will help you in understanding the concepts better.

Code Example 1

string s, tmp; 
stringstream ss(s);
vector<string> words;

// If there is one element (so komma) then push the whole string
if(getline(ss, tmp, ',').fail()) {
  words.push_back(s);
}
while(getline(ss, tmp, ',')){
    words.push_back(tmp);
}

Learn ReactJs, React Native from akashmittal.com