Return the last 'n' chars of string.
Install
Install all functions of strman
yarn add strmanor just the last function
yarn add strman.lastUsage
import { last } from 'strman'
// OR
import last from 'strman.last'Parameters:
| Name | Type | Description |
|---|---|---|
value |
String | The String! |
n |
String | Number of chars to return. |
Returns:
Return 'n' lasts chars.
- Type
- String
Example
const title = 'strman'
last(title, 3)
// => 'man'