StringStream

  • + 0 comments
    {
        vector<int> tokens;
        stringstream ss(str); 
        string token;
        char delimeter = ',';
        while (getline(ss, token, delimeter)) { 
            tokens.push_back(stoi(token)); 
        } 
        return tokens;
    }