UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

26 lines (25 loc) 613 B
/** * Checks if `string` ends with the given target string. * * @since 5.7.0 * @category String * @param str The string to inspect. * @param target The string to search for. * @param position The position to search up to. * @returns Returns `true` if `string` ends with `target`, else `false`. * @see [[includes]],[[startsWith]] * @example * * ```js * endsWith('abc', 'c') * // => true * * endsWith('abc', 'b') * // => false * * endsWith('abc', 'b', 2) * // => true * ``` */ export declare function endsWith(str: string, target: string, position?: number): boolean; export default endsWith;