trimAny method

string trimAny(
  1. Iterable<String?> patterns
)

Trims the current string by removing any of the specified patterns from both the start and the end of the string.

This method first removes any of the specified patterns from the end of the string, and then removes any of the specified patterns from the start of the string.

  • Parameter patterns: An iterable collection of string patterns to be removed from the start and end of the string.
  • Returns: A new string with the specified patterns removed from both the start and the end.

Implementation

string trimAny(Iterable<String?> patterns) => removeLastAny(patterns).removeFirstAny(patterns);