endsWith

Test if value ends with search

Install

Install all functions of strman

yarn add strman

or just the endsWith function

yarn add strman.endswith

Usage

import { endsWith } from 'strman'
// OR
import endsWith from 'strman.endswith'
Parameters:
Name Type Attributes Default Description
value String

The input string

search String

The string to search for

position Number <optional>

The start position/index within value to start searching

caseSensitive Boolean <optional>
true

Use case (in-)sensitive matching

Source:
Returns:

True if input ends with search

Type
Boolean
Example
const value = 'Daniel Leite'
const search = 'Leite'
endsWith(value, search)
// => true