i've read around many solutions to find and replace substring in a string.
I'm a little confused.
I need to parse a string as follow: /MySoftware/Development/Games
The final string should be as follow: MySoftware:Development/Games
I used some code found in this very site, but i had some problems.
As example:
1 2 3 4 5 6 7 8 9 10 11 12
#include <algorithm>
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
string s = "The quick brown fox jumps over the lazy dog.";
replace( s.begin(), s.end(), ' ', '~' );
cout << s << endl;
return 0;
}
this replace all the occurences in the string.
It is possible to find and replace the first occurence of a char?
In my case: /MySoftware/Development/Games i need to "cut" the first "/" and i have to replace the second "/" with ":"