StringRemoveSurroundingExtension extension

on

Methods

removeSurrounding({required String prefix, required String suffix}) String

Available on String, provided by the StringRemoveSurroundingExtension extension

Removes from a String both the given prefix and suffix if and only if it starts with the prefix and ends with the suffix. Otherwise returns this String unchanged.