public String substring(int beginIndex)
Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string. 
Examples:  "unhappy".substring(2) returns "happy"
 "Harbison".substring(3) returns "bison"
 "emptiness".substring(9) returns "" (an empty string)

解决方案 »

  1.   

    直接调用str.substring( 2 );即可!
      

  2.   

    String substring(int beginIndex, int endIndex) 
              Returns a new string that is a substring of this string.
      

  3.   

    public class TestSubString{
    public static void main(String[] args){
    String s = "你好我想向你提个问题";

    String substr = "";
    substr = s.substring(0,6);
    System.out.println(substr);
    }
    }
      

  4.   

    调用str.substring( 0,2 );是取前两个字符。两个汉字应是4 个字符。
    string a=“你好我想提个问题”
    string b=a.substring( 0,4 );
    b 是你想要的东西了
      

  5.   

    楼上正解
    楼主其实看看String的API就能查到
    嘿嘿,混分啦!!