Of course. I hadn't seen that in the cplusplus.com reference for cstring. In fact, cplusplus.com has apparently no documentation for substr at all.
substr() is not a function of cstring -- it is a method of c++ std::string class.
#include <string>
int main()
{
std::string newstr;
std::string str = "why,hello";
int pos = str.find(',');
if(pos > 0)
mewstr = str.substr(pos+1);
return 0;
}
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343