How can I actually erase 11 from the string, without using string.erase since it requires position. And I don't want it to erase 11 in 1100 only 11 which is followed by a space!
Use find() on "11 " and erase that.
Alternatively, use split+erase+join (boost has implementation of split and join, but you can just as easily write your own).