c++ 字符串截取

	string path="D:\aa\bb\cc.txt";
	string mainpath;
	string::size_type pos = path.find_last_of('\');
if( pos != string::npos )
{
   mainpath.assign( path, 0, pos + 1 );
}
原文地址:https://www.cnblogs.com/marky/p/3195388.html