StringBetweenExtensions extension

Extension methods for extracting content between delimiters.

on

Methods

between(String start, String end, {bool endOptional = true, bool trim = true}) → String

Available on String, provided by the StringBetweenExtensions extension

Returns the content between the first occurrence of start and end.
betweenBrackets() → String?

Available on String, provided by the StringBetweenExtensions extension

Returns the content between the first matching bracket pair found, or null if none is found.
betweenBracketsResult() → BetweenResult?

Available on String, provided by the StringBetweenExtensions extension

Returns a BetweenResult of (content between brackets, remaining string) for the first matching bracket pair found.
betweenBracketsResultLast() → BetweenResult?

Available on String, provided by the StringBetweenExtensions extension

Returns a BetweenResult like betweenBracketsResult but searches from the end. Audited: 2026-06-12 11:26 EDT
betweenLast(String start, String end, {bool endOptional = true, bool trim = true}) → String

Available on String, provided by the StringBetweenExtensions extension

Returns the content between the last occurrence of start and end.
betweenResult(String start, String end, {bool endOptional = false, bool trim = true}) → BetweenResult?

Available on String, provided by the StringBetweenExtensions extension

Returns a BetweenResult of content between start and end delimiters plus the remaining string, or null if not found.
betweenResultLast(String start, String end, {bool endOptional = true, bool trim = true}) → BetweenResult?

Available on String, provided by the StringBetweenExtensions extension

Returns a BetweenResult like betweenResult but searches from the end using start and end delimiters.
betweenSplit(String start, String end, {bool endOptional = true, bool trim = true}) → List<String>?

Available on String, provided by the StringBetweenExtensions extension

Returns a list of all sections found between start and end delimiters, or null if none are found.
removeBetweenAll(String start, String end, {bool inclusive = true}) → String

Available on String, provided by the StringBetweenExtensions extension

Returns a new string with all content between start and end delimiters removed.