If I have a string like this :
asdasda=1lsdn=sdf=3dfsdf=-sadf= adfgh=1fbfg=fgfg
what is the fastest way to remove a character if 1) it comes after an = and 2) that character is a non alphabet.
In this case the o/p of the function will be :
asdasda=lsdn=sdf=dfsdf=sadf=adfgh=fbfg=fgfg
I am coding in c++.
This is what I have so far
std::string b = "asdasda=1lsdn=sdf=3dfsdf=-sadf= adfgh=1fbfg=fgfg"; int a= 1; while(a != 0){ a = b.find('=', a); a++; if(!isalpha(b[a])){ b.erase(a,1); } } std::cout << b << std::endl;
I am not a c++ developer but how much i know c++ ,i think best solution for your problem is.
}
There in code may be syntax error , Please check this code before use.
thanks