Check out example codes for "splice string in c++". It will help you in understanding the concepts better.

Code Example 1

string str1 = "Apples are red";
string str2 = str1.substr(11, 3); // "red"
string str3 = str1.substr(0, 6); // "Apples"

Learn ReactJs, React Native from akashmittal.com