I currently have a bunch of SQLCHAR objects from a database query. The query results are stored in a std::string and then binded to the individual SQLCHAR variables. Some of these variables need to be parsed in order to remove any non-alphanumeric characters. What is the best approach here?
I have implemented a basic parsing of a std::string ...
for (std::string::iterator i = str.end()-1; i >= str.begin(); --i)
{
if ( !isalpha(*i) && !isdigit(*i) )
{
str1.erase(i);
}
}
But now I have the problem of converting a SQLCHAR to a std::string and then back again. Is there a better way to do this?