<%
String mystr="ballack";
out.print(mystr.substring(1,4));
%>

解决方案 »

  1.   

    String msg = "Hello world";System.out.println(msg.substring(nBegin,nBegin+nCount));
      

  2.   

    strString.substring(m,n)
    从第m位取n位
      

  3.   

    送分噢。下面的英文文档应该看的懂吧。看不懂偶再帮你翻译。public String substring(int beginIndex, int endIndex)
    Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex. Examples:  "hamburger".substring(4, 8) returns "urge"
     "smiles".substring(1, 5) returns "mile"
      

  4.   

    编译后产生的ERROR: Method subString(init,int ) not found in class java.lang.String.
    应该加上哪个CLASS ?
      

  5.   

    public String substring(int beginIndex, int endIndex)
    注意是substring, 而不是subString
      

  6.   

    subString --> substring 没有大写
      

  7.   

    我明白了: substr(str,m,n)=>  str.substring(m,m+n);