Search
 
SCRIPT & CODE EXAMPLE
 

CPP

split string on character vector C++

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);
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to make calculaor in c++ 
Cpp :: string reverse stl 
Cpp :: loop through a vector in c++ 
Cpp :: c++ function as param 
Cpp :: elements of set c++ 
Cpp :: how to get size of char array in c++ 
Cpp :: number of lines in c++ files 
Cpp :: c++ terminal color 
Cpp :: fstring from float c++ ue4 
Cpp :: max heap in c++ 
Cpp :: cpp create multidimensional vector 
Cpp :: find primes in a range in c++ 
Cpp :: How to pause a c++ program. 
Cpp :: How to find the suarray with maximum sum using divide and conquer 
Cpp :: C++ cin cout 
Cpp :: glew32.dll was not found 
Cpp :: c++ default parameters 
Cpp :: how to use char in c++ 
Cpp :: lutris 
Cpp :: checking if a string has only letters cpp 
Cpp :: c++ output 
Cpp :: find prime number c++ 
Cpp :: how to append to a vector c++ 
Cpp :: insert a character into a string c++ 
Cpp :: find kth max and min element in an array 
Cpp :: sleep in c++ 
Cpp :: temperature conversion in c++ 
Cpp :: error handling in c++ 
Cpp :: stack c++ 
Cpp :: check if a key is in map c++ 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =