I have the position to start, and the length of the sting that I want
How can I get that string?
For example,
Hi, how are you?
how can I start getting the string with the word how, and the length of 5?
1 2 3
|
string mystring;
mystring="Hi, how are you?";
cout << mystring.erase(0,4) << endl;// Starting at 0, delete chars 4
|
Last edited on
How about if I want to read the word between how and you?
Therefore i will get
, how are