getAllBeforeFirst method

String? getAllBeforeFirst(
  1. String target
)

Returns text placed before first target

Implementation

String? getAllBeforeFirst(String target) {
  if (!contains(target)) return null;
  return substring(0, indexOf(target));
}