String java.lang.String.substring(int beginIndex)



String java.lang.String.substring(int beginIndex)
部分文字列を返す
文字列のサブ文字列を返します.サブストリングは、インデックス内の文字の先頭を指定し、その文字列の末尾に拡張します.(インデックスの先頭は0です.)
String str = "012345";
String tmp = str.substring(1,4);	//str에서 index의 범위 1~4의 문자들을 반환
System.out.println(tmp);	//"123"이 출력된다
//index의 범위가 1~4라면 4는 범위에 포함되지 않는다.
Returns a 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)
Parameters:
beginIndex the beginning index, inclusive.
Returns:
the specified substring.
Throws:
IndexOutOfBoundsException - if beginIndex is negative or larger than the length of this String object.