lastLeftPart function

String? lastLeftPart(
  1. String? strVal,
  2. String needle
)

Implementation

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