判断该String是否是以("")中的字符开头的
比如:if (strSvrName.startsWith("query"))
      {
       }

解决方案 »

  1.   

    public boolean startsWith(String prefix,
                              int toffset)prefix - the prefix.
    toffset - where to begin looking in the string.
    例如String a="abcdef";
    a.startsWith("abc",0)就返回true
      

  2.   

    String str="sdfsd";str.startsWith("sd");就返回true  
    String.startsWith("")没意义
      

  3.   

    LogoGEN(流氓)讲的很具体,还有例子。都让 LogoGEN(流氓) 讲了,我就不知道该再说什么了。