Now I have a C++ string like this
string str = " 1 30716 5 5 2 2 6";
I need to split the string and get all non-empty elements1
,30716
,5
,5
,2
,2
,2
and6
. How can I do this?
By the way, someone just told me that C# can do this easily by using string.Split(separator,StringSplitOptions.RemoveEmptyEntries)
.Can I do the same thing in C++?
Aucun commentaire:
Enregistrer un commentaire