Returns text placed before first target
String? getAllBeforeFirst(String target) { if (!contains(target)) return null; return substring(0, indexOf(target)); }