string 操作:
1 =,assign() //赋以新值 2 s.assign(str); 3 s.assign(str,1,3);//如果str是”iamangel” 就是把”ama”赋给字符串 4 s.assign(str,2,string::npos);//把字符串str从索引值2开始到结尾赋给s 5 s.assign(“gaint”); 6 s.assign(“nico”,5);//把’n’ ‘i’ ‘c’ ‘o’ ‘
1 =,assign() //赋以新值 2 s.assign(str); 3 s.assign(str,1,3);//如果str是”iamangel” 就是把”ama”赋给字符串 4 s.assign(str,2,string::npos);//把字符串str从索引值2开始到结尾赋给s 5 s.assign(“gaint”); 6 s.assign(“nico”,5);//把’n’ ‘i’ ‘c’ ‘o’ ‘