public class Substring extends Object
Modifier and Type | Field and Description |
---|---|
int |
end
The end of the substring
|
int |
start
The start of the substring
|
String |
string
The string this is a substring of
|
Constructor and Description |
---|
Substring(int start,
int end,
String string) |
Modifier and Type | Method and Description |
---|---|
char |
charAfter(int n)
Returns the character n places (0 base) after the end of the value substring into the superstring.
|
char |
charBefore(int n)
Returns the character n places (0 base) before the start of the value substring into the superstring.
|
String |
getSuperstring()
Returns the entire string this is a substring of.
|
String |
getValue() |
String |
toString() |
public final int start
public final int end
public final String string
public Substring(int start, int end, String string)
public String getValue()
public String getSuperstring()
public char charAfter(int n)
IndexOutOfBoundsException
- if the string is not long enough to have a character at this positionpublic char charBefore(int n)
IndexOutOfBoundsException
- if the string does not have a character at this positionCopyright © 2017. All rights reserved.