This is really ticking me off.
Ok I have a program like so:-
#include <iostream>
#include <string>
using namespace std;
int main()
{
string crap = "dfgfd-rergreg-dfgfdg-ertertd-gfdg-df";
}
And all I wanna do is replace the "-"
with " - "
. Note the spaces.
I've tried everything but it won't work.
Shit like this won't work. Why?
for ( int i = 0; i < crap.length(); i++)
{
if (crap[i] =='-')
{
crap.replace(i,1," - ");
}
}
wtf?