removeSecond method

String removeSecond(
  1. String subString
)

removeSecond: removes the second occurrence of a substring

Implementation

String removeSecond(String subString) {
  if (isNull) return "";
  int index = this!.indexOf(subString);
  if (index == -1) return this!;
  return this!.substring(0, index) + this!.substring(index + subString.length);
}