removeLast method

String removeLast(
  1. String subString
)

removeLast: removes the last occurrence of a substring

Implementation

String removeLast(String subString) =>
    this?.replaceFirst(subString, "") ?? "";