thestring.erase(thestring.find(" 1"),2);
assuming, it's there. This is not the code to use it's a hint about what to look up in the documentation.
The problem you have is probably to determine the size in bytes of the particular string in characters. It depends on the encoding, but generally you may want to look at the family of functions with mb
in their names (which stands for multibyte).