strstr
strchar
CString::find
string::find

解决方案 »

  1.   

    CString strname,strtype;
    strname="image.jpg?become=home";
    strtype="king.html/site";
    int pos1=strname.Find("?");
    int pos2=strtype.Find("/");结果:
    pos1=9
    pos2=9是不是你想要的?
      

  2.   

    CString strname,output;
    strname="image.jpg?become=home";
    int inascii,i;
    for(i=1;i++;i<strname.GetLength())
    {
    inascii=int(strname.GetAt(i));
    if(!((inascii<123&&inascii>96)||(inascii<91&&inascii>64)))
    {
    output.Format("第一个非英文字符位于:%d",i);
    MessageBox(output);
    break;
    }
       
    }
      

  3.   

    谢谢大家,尤其感谢呢呢!
    qiuanhong(练从难处练,用从易处用) ,我想要的是通用的解决方案!