@plexis/toSwap
Swaps every character with the next one in a given string.
npm i @plexis/to-swap
Usage
import toSwap from '@plexis/to-swap';
toSwap('ab'); // returns 'ba'
toSwap('abc'); // returns 'bac'
toSwap('abcd'); // returns 'badc'
toSwap('a b'); // returns ' ab'
Aliases
import {toSwap} from 'plexis';
import {swap} from 'plexis';