Re: Replacing a substring in a string [message #479997 is a reply to message #479987] |
Wed, 20 March 2013 00:56 |
|
danpaul88
Messages: 5795 Registered: June 2004 Location: England
Karma:
|
General (5 Stars) |
|
|
std::string::replace replaces a set of characters between indexes N and M with a different set of characters. Whilst it can be used as a substring replacement it takes a bit of finangling to make it work and it still needs an iterative approach so it will potentially make lots of unnecessary intermediate buffer reallocations if the new string is >= the length of the string being replaced.
[Updated on: Wed, 20 March 2013 00:56] Report message to a moderator
|
|
|