比如输入 8802135986351
输出结果为:(就是把 生日和后面的代码 分 两行输出)
880213
5986351

解决方案 »

  1.   

    那位给  写一下比较急。。 感激ing
      

  2.   

    生日的年加月日共6位,所以你
    String s="8802135986351";
    String s1=s.subString(0,6);
    String s2=s.subString(6,s.length());
    system.out.println(s1);
    system.out.println(s2);
      

  3.   

    String s2=s.subString(6,s.length());
    这里的s Substring 分别什么意思啊?/
      

  4.   

    String str = "8802135986351";
    if (str.length() >= 6) {
    System.out.println(str.substring(0, 6));
    System.out.println(str.substring(6,str.length()));
    }
      

  5.   

    分割字符串,你自己去查api文档的String方法,
      

  6.   

    用eclipse直接查看jdoc:
    substring
    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"
     Parameters:
    beginIndex - the beginning index, inclusive.
    endIndex - the ending index, exclusive. 
    Returns:
    the specified substring. 
    Throws: 
    IndexOutOfBoundsException - if the beginIndex is negative, or endIndex is larger than the length of this String object, or beginIndex is larger than endIndex.
      

  7.   

    用substring这个方法截取就好了。