@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

        Input string, or null/undefined.

      • delimiter: string | RegExp

        String or regex marking where to start.

      • Optionalon_missing: T

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

      Returns T

      The substring after the delimiter (may be empty string), or on_missing.

      If the delimiter is found at the end of the string, an empty string is returned (not on_missing).

      substringAfter("path/to/file.txt", '/');     // "to/file.txt"
      substringAfter("abc123xyz", /\d+/); // "xyz"
      substringAfter("abc123", /\d+/); // "" (empty string)
      substringAfter(undefined, ':'); // null
      substringAfter("no-needle", ':', 'default'); // 'default'
    • Returns the substring after the first occurrence of the delimiter.

      Type Parameters

      • T extends string | null = null

      Parameters

      • s: Nullable<string>

        Input string, or null/undefined.

      • delimiter: string | RegExp

        String or regex marking where to start.

      • Optionalon_missing: T

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

      Returns string | T

      The substring after the delimiter (may be empty string), or on_missing.

      If the delimiter is found at the end of the string, an empty string is returned (not on_missing).

      substringAfter("path/to/file.txt", '/');     // "to/file.txt"
      substringAfter("abc123xyz", /\d+/); // "xyz"
      substringAfter("abc123", /\d+/); // "" (empty string)
      substringAfter(undefined, ':'); // null
      substringAfter("no-needle", ':', 'default'); // 'default'