getEverythingAfter method
Returns the substring after the first occurrence of find
.
Returns the original string if find
is not found.
Implementation
String getEverythingAfter(String find) {
// Find the index of the target string.
final int atIndex = indexOf(find);
// Return the substring after the index, or the original string if not found.
return atIndex == -1 ? this : substring(atIndex + find.length);
}