Hi...I have a problem..
I need a function which is able to remove a word from string and replace it with other word (string)..
I have nice working function in pure c++ but I dunno how to do that in visual c++ ;(
10x for help!
void FindAndReplace( std::string& tInput, std::string tFind, std::string tReplace )
{
size_t uPos = 0;
size_t uFindLen = tFind.length();
size_t uReplaceLen = tReplace.length();
if( uFindLen == 0 )
{
return;
}
for( ;(uPos = tInput.find( tFind, uPos )) != std::string::npos; )
{
tInput.replace( uPos, uFindLen, tReplace );
uPos += uReplaceLen;
}
}