swap-text
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Swap text Travis CI Build Status

Swap characters in a string.

NPM Badge

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.

Package Sidebar

Install

npm i swap-text

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

3.17 kB

Total Files

6

Last publish

Collaborators

  • richienb