removeSurrounding method

String removeSurrounding({
  1. required String prefix,
  2. required String suffix,
})

Implementation

String removeSurrounding({required String prefix, required String suffix}) {
  if (startsWith(prefix) && endsWith(suffix)) {
    return substring(prefix.length, length - suffix.length);
  } else {
    return this;
  }
}