removeFirstAndLastEqual method

String? removeFirstAndLastEqual(
  1. String? pattern
)

Removes any pattern match from the beginning & the end of the String.

Example

String edited = "abracadabra".removeFirstAndLastEqual("a"); // returns "bracadabr";

Implementation

String? removeFirstAndLastEqual(String? pattern) =>
    removeFirstEqual(pattern).removeLastEqual(pattern);