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 );
}

 

posted on 2013-07-17 11:14  markygis  阅读(594)  评论(0编辑  收藏  举报