after method
- String char
Returns the right side of the String
starting from char
.
If char
doesn't exist, null
is returned.
Example
String s = 'peanutbutter';
String foo = s.rightOf('peanut'); // returns 'butter'
Implementation
String after(String char) {
if (isBlank) {
return blankIfNull;
}
int index = indexOf(char);
if (index == -1) {
return "";
}
return substring(index + char.length, length);
}