i want to replace a character in the string with a string. can i do it in-place? As the new string has length greater than original string.Question is that can i do with
I think you misundertand C++ std::string. It can actually change the string length dynamically. In internally does heap allocations, and will grow the buffer if necessary.