getEverythingBefore method
Returns the substring before the first occurrence of find.
Returns the original string if find is not found.
Implementation
@useResult
String getEverythingBefore(String find) {
final int atIndex = indexOf(find);
return atIndex == -1 ? this : substringSafe(0, atIndex);
}