simple c++ duty -- formula "good"?
the following formula assembled consultant operative group. i'm c++ developer (worked languages, though) nonetheless individualist opinions following code. visible studio c++ 6.0. i've got stomach nod (not good one, obviously), nonetheless i'd "gut reactions" seasoned (or even unseasoned) c++ developers out there. interjection advance!
// instance call
strcolheader = insert_escape(strcolheader, ',', '\\'); //get absolved commas an evade character
...snip...
cstring insert_escape ( cstring originalstring, bake charfind, bake charinsert ) {
bool continueloop = true;
int currentind = 0;
{
int occurenceind = originalstring.find(charfind, currentind);
if(occurenceind>0) {
originalstring.insert(occurenceind, charinsert);
currentind = occurenceind + 2;
}
else {
continueloop = false;
}
} while(continueloop);
return(originalstring);
}
Comments
Post a Comment