trimPattern method

String trimPattern(
  1. String pattern
)

Implementation

String trimPattern(String pattern) {
  String tempString = this;
  if (startsWith(pattern)) {
    tempString = substring(pattern.length, tempString.length);
  }
  if (endsWith(pattern)) {
    tempString = substring(0, tempString.length - pattern.length);
  }
  return tempString;
}