between method

String between(
  1. String before,
  2. String after
)

Returns the text between before and after strings.

If before or after are not found, an empty string is returned.

Example

String text = 'Hello [world]!';
String result = text.between('[', ']'); // returns 'world'

Implementation

String between(String before, String after) => this.before(before).after(after);