Check out example codes for "remove last character from string c++". It will help you in understanding the concepts better.

Code Example 1

st = myString.substr(0, myString.size()-1);

Learn ReactJs, React Native from akashmittal.com