#include <iostream>
#include <vector>
#include <list>
#include <string>
#include <algorithm>
using namespace std;
int main(int argc,char **argv)
{
string numerics("0123456789");
string str("ab2c3d7R4E6");
string::size_type pos=0;
while((pos=str.find_first_of(numerics,pos))!=string::npos)
{
cout<<"Found it at index:"<<pos
<<" Element is:"<<str[pos]<<endl;
++pos;
}
pos=0; //将位置还原到开始
cout<<"***************************"<<endl;
while((pos=str.find_first_not_of(numerics,pos))!=string::npos)
{
cout<<"Found it at index:"<<pos
<<" Element is:"<<str[pos]<<endl;
++pos;
}
return 0;
}