@jiminp/tooltool
    Preparing search index...

    Function substringAfter

    • Returns the substring after the first occurrence of the delimiter.

      Type Parameters

      • T extends string | null = null

      Parameters

      • s: Nullish

        String (or null/undefined) to find the substring of.

      • delimiter: string | RegExp

        Needle that marks where the cropped string should start.

      • Optionalon_missing: T

        Value to return when s is nullish or delimiter is not found (defaults to null).

      Returns T

      • The substring that follows the first occurrence of delimiter.
      • on_missing if s is null/undefined or if the delimiter cannot be found.
      substringAfter("path/to/file.txt", '/');       // "to/file.txt"
      substringAfter("abc123", /\d+/); // ''
      substringAfter("abc123xyz", /\d+/); // "xyz"
      substringAfter(undefined, ':'); // null
      substringAfter("no-needle", ':'); // null
      substringAfter("no-needle", ':', 'default'); // 'default'
      substringAfter(null, ':', ''); // ''
    • Returns the substring after the first occurrence of the delimiter.

      Type Parameters

      • T extends string | null = null

      Parameters

      • s: Nullable<string>

        String (or null/undefined) to find the substring of.

      • delimiter: string | RegExp

        Needle that marks where the cropped string should start.

      • Optionalon_missing: T

        Value to return when s is nullish or delimiter is not found (defaults to null).

      Returns string | T

      • The substring that follows the first occurrence of delimiter.
      • on_missing if s is null/undefined or if the delimiter cannot be found.
      substringAfter("path/to/file.txt", '/');       // "to/file.txt"
      substringAfter("abc123", /\d+/); // ''
      substringAfter("abc123xyz", /\d+/); // "xyz"
      substringAfter(undefined, ':'); // null
      substringAfter("no-needle", ':'); // null
      substringAfter("no-needle", ':', 'default'); // 'default'
      substringAfter(null, ':', ''); // ''