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
(int start)
| 754 | * "unhappy".substring(2) returns "happy" "Harbison".substring(3) returns "bison" "emptiness".substring(9) returns "" (an empty string) |
| 755 | */ |
| 756 | public java.lang.String substring(int start){ |
| 757 | if (start == 0) { |
| 758 | return this; |
| 759 | } |
| 760 | if (start >= 0 && start <= count) { |
| 761 | //return new String(offset + start, count - start, value); |
| 762 | return new String(value, offset + start, count - start); |
| 763 | } |
| 764 | throw new ArrayIndexOutOfBoundsException(start); |
| 765 | } |
| 766 | |
| 767 | /** |
| 768 | * 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. |
no outgoing calls