1.0.0 • Published 4 years ago
swap-text v1.0.0
Swap text
Swap characters in a string.
Install
npm install swap-text
Usage
const swapText = require("swap-text");
swapText("abcdef", "ab", "cd")
//=> 'cdabef'
API
swapText(string, a, b)
string
Type: string
The text to transform.
a
Type: string
The first group of characters to swap with the second.
b
Type: string
The second group of characters to swap with the first.