-
(Clarified 2/12/2002)
Specify
two ints. The substring will have the character at the position of the first int
as its first character, and its last character will be the character before the
character at the position of the last int. Of course, it will include all characters
between those two. In other words, the first int inclusive, the last int is
non-inclusive.
-
Specify
one int. The substring will start at that int and continue to
the end of the String.
-
Examples:
String firstString = "Hello World!";
String secondString = firstString.substring(0,5);
// secondString now holds the String "Hello".
String thirdString = firstString.substring(6);
// thirdString now holds the string "World".