How to split in cpp | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to split in cpp

How can i split an string in to an array/vector

9th Aug 2020, 4:23 PM
sid - avatar
3 Answers
9th Aug 2020, 4:38 PM
Jayakrishna 🇮🇳
+ 1 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
9th Aug 2020, 7:13 PM
george - avatar
+ 1
convert std::string to std::vector<char> using std::copy: split words with std::istringstream:
9th Aug 2020, 8:37 PM
Ockert van Schalkwyk
Ockert van Schalkwyk - avatar