import { StringUtil } from "https://deno.land/x/tstl@v3.0.0/benchmark/internal/StringUtil.ts";
Generate a substring.
Extracts a substring consisting of the characters from specified start to end. It's same with str.substring( ? = (str.find(start) + start.size()), str.find(end, ?) )
const str: string = StringUtil.between("ABCD(EFGH)IJK", "(", ")");
console.log(str); // PRINTS "EFGH"
- If start is not specified, extracts from begin of the string to end.
- If end is not specified, extracts from start to end of the string.
- If start and end are all omitted, returns str, itself.