|
-
January 26th, 2003, 08:11 PM
#1
STL, find / replace all occurences of a substring in a string
Sorry for stupid question, but...
The problem is as follows. For two given std::strings s1 and s2 I must find all occurences of s2 in s1 and replace them with, say, s3 (C++,STL). Of course, there's a number of different solutions of the problem. But I do want to find solution that can be expressed "in one string", using a combination of some usual STL algorithms, without explicit "find-replace" cycle.
I tried hard but I can't invent it by myself. I remember that I have already seen such a thing somewhere oin the net, but I can't found it in any way. So, I'm just going insane. Help me, please.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|