Returns the substring after the first occurrence of the delimiter.
Input string, or null/undefined.
null
undefined
String or regex marking where to start.
Optional
Returned if s is nullish or delimiter not found (default: null).
s
The substring after the delimiter (may be empty string), or on_missing.
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, ':'); // nullsubstringAfter("no-needle", ':', 'default'); // 'default' Copy
substringAfter("path/to/file.txt", '/'); // "to/file.txt"substringAfter("abc123xyz", /\d+/); // "xyz"substringAfter("abc123", /\d+/); // "" (empty string)substringAfter(undefined, ':'); // nullsubstringAfter("no-needle", ':', 'default'); // 'default'
Returns the substring after the first occurrence of the delimiter.