Surrounds a 'value' with the given 'substr'.
Install
Install all functions of strman
yarn add strman
or just the surround function
yarn add strman.surround
Usage
import { surround } from 'strman'
// OR
import surround from 'strman.surround'
Parameters:
Name | Type | Description |
---|---|---|
value |
String | The String! |
substr |
String | The substr to append on left, if substrRight is null, this is appended in right. |
substrRight |
String | The substr to append on right. |
- Source:
Returns:
The String with surround substrs!
- Type
- String
Example
surround('strman', '<', '>')
// => '<strman>'