c++处理字符串string.find()与string::npos 1. string s = “xxx”; int a = s.find(‘x’); 如果没有匹配到,那么a = string::npos;