substring(int beginIndex,int length)的参数

public String substring(int beginIndex,int length)。
      返回一个新字符串,它是此字符串的一个子字符串。该子字符串从指定的 beginIndex 处开始, length:表示子字符串的长度。

      参数:
  beginIndex - 开始处的索引(包括)。
  endindex 结尾处索引(不包括)。

  返回:
  指定的子字符串。

    示例:

 String str = "ABCDEF";

String str1 = str.substring(2, 4);

  返回 CD

posted @ 2014-02-22 19:39  Mr_Clint  阅读(217)  评论(0编辑  收藏  举报