@jiminp/tooltool
    Preparing search index...

    Function substringBetween

    • Returns the substring between the first start and the first end after it.

      Type Parameters

      • T extends string | null = null

      Parameters

      • s: Nullish

        Input string, or null/undefined.

      • start: string | RegExp

        String or regex marking where to start.

      • end: string | RegExp

        String or regex marking where to end.

      • Optionalon_missing: T

        Returned if s is nullish or delimiters not found (default: null).

      Returns T

      The substring between delimiters, or 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
    • Returns the substring between the first start and the first end after it.

      Type Parameters

      • T extends string | null = null

      Parameters

      • s: Nullable<string>

        Input string, or null/undefined.

      • start: string | RegExp

        String or regex marking where to start.

      • end: string | RegExp

        String or regex marking where to end.

      • Optionalon_missing: T

        Returned if s is nullish or delimiters not found (default: null).

      Returns string | T

      The substring between delimiters, or 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