I have to copy originalString to newString except for the first character (~). The content of originalString should not be changed.
std::string originalString("~myOriginalString");
std::string newString;
…
// expected result: newString is "myOriginalString", originalString is unmodified.
In general, this sort of operation can be performed with iterators: