Extract a consecutive series of characters from within a string.
String |
The method subSequence() retrieves a subset of characters from the string and returns it as a CharSequence object.
public |
Parameter |
Description |
start |
Necessary: Provide the index of the character where the subsequence begins. |
end |
Necessary: Specify the index immediately following the last character of the subsequence. |
Returns |
A CharSequence containing a portion of the original string |
Throws |
The IndexOutOfBoundsException occurs when either the start or end parameters are negative, when start exceeds end, or when end surpasses the length of the string. |
Java Version |
1.4 |