within static method

String within(
  1. String string,
  2. String left,
  3. String right
)

Returns the string bounded by the left and right delimiters. Throws an ArgumentError exception if either of the delimiters are missing. If there are nested delimiters we return the outer most delimiters.

 final result= Strings.within("<AnInstance>", '<', '>');
 result == 'AnInstance';

Implementation

static String within(String string, String left, String right) =>
    Part.within(string, left, right);