Return the first 'n' chars of string.
Install
Install all functions of strman
yarn add strman
or just the first function
yarn add strman.first
Usage
import { first } from 'strman'
// OR
import first from 'strman.first'
Parameters:
Name | Type | Description |
---|---|---|
value |
String | The String! |
n |
String | Number of chars to return. |
Returns:
Return n
firsts chars.
- Type
- String
Example
first('strman', 3)
// => 'str'