Strings.skipUntilLast()
Syntax
function skipUntilLast(string: string, substring: string): string
Returns all characters in the string after the last occurrence of the substring, including the substring itself.
| Parameters | |
string
|
The string to take characters from. |
substring
|
The substring to find within |
Example
import { Strings } from 'potence';
const string = 'https://www.github.com';
Strings.skipUntilLast(string, '.'); // -> ".com"
Remarks
If the string does not contain the substring, this function returns an empty string.
Contrast Strings.takeUntilLast().
Compare Strings.skipUntil(),
Strings.skipUntilAfter(),
Strings.skipUntilAfterLast(),
and Strings.skipLast().