StringRemoveSurroundingExtension extension

on

Methods

removeSurrounding({required String prefix, required String suffix}) String
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.