+ 1
How to split in cpp
How can i split an string in to an array/vector
3 Réponses
+ 4
Learn about string tokenizer function strtok() in c..
Edit: sid https://www.google.com/amp/s/www.geeksforgeeks.org/strtok-strtok_r-functions-c-examples/amp/
C++ split:
https://www.google.com/amp/s/www.geeksforgeeks.org/boostsplit-c-library/amp/
+ 1
https://code.sololearn.com/clAS6jyKT3fu/?ref=app
sid there are 2 variants 1 variant is old c++ style, the second one is c++11 variant, using foreach and lambda function. i use rbegin and rend for test. but in fact need use begin and end function
+ 1
convert std::string to std::vector<char> using std::copy: https://code.sololearn.com/cRR56Zv01TB6/#cpp
split words with std::istringstream: https://code.sololearn.com/cpGQp3IuJ5ll/#cpp