Do not use std::string::replace to replace a signle character in a std::string (just assign the desired character to the position).
