String? lastLeftPart(String? strVal, String needle) { if (strVal == null) return null; var pos = strVal.lastIndexOf(needle); return pos == -1 ? strVal : strVal.substring(0, pos); }