Returns the substring between the first start and the first end after it.
start
end
Input string, or null/undefined.
null
undefined
String or regex marking where to start.
String or regex marking where to end.
Optional
Returned if s is nullish or delimiters not found (default: null).
s
The substring between delimiters, or on_missing.
on_missing
Search for end begins after start. Occurrences of end before start are ignored.
substringBetween("<a>b</a>", "<a>", "</a>"); // "b"substringBetween("yabbadabbadoo", "abba", "doo"); // "dabba"substringBetween("<a>b", "<a>", "</a>"); // null Copy
substringBetween("<a>b</a>", "<a>", "</a>"); // "b"substringBetween("yabbadabbadoo", "abba", "doo"); // "dabba"substringBetween("<a>b", "<a>", "</a>"); // null
Returns the substring between the first
startand the firstendafter it.