string srt="abcdef"; string str2=str.substr(1,3);//->str2="bcd" //应用实例 string str3="zhangsan@qq.com"; int pos=str3.find("@"); string name= str3.substr(0,pos);