@aegenet/belt-string-split
TypeScript icon, indicating that this package has built-in type declarations

2.3.0 • Public • Published

npm version

@aegenet/belt-string-split

String Split is an alternative to String.split, with the ability to ignore the split character inside 'tags'

💾 Installation

yarn add @aegenet/belt-string-split@^2.0.0
# or
npm i @aegenet/belt-string-split@^2.0.0

📝 Usage

import { StringSplit } from '@aegenet/belt-string-split';

const stringSplit = new StringSplit({
  separator: ' ',
  ignoreTags: {
    '"': '"',
  },
});

stringSplit.split('Hello Brian "Something Else"');
//  ['Hello', 'Brian', '"Something Else"']

const stringSplit = new StringSplit({
  separator: ' ',
  ignoreTags: {
    '(': ')',
  },
});

stringSplit.split('Hello Brian (Something Else)');
// ['Hello', 'Brian', '(Something Else)']
stringSplit.split('Hello Brian (Something Else (or something))');
// ['Hello', 'Brian', '(Something Else (or something))']

Readme

Keywords

Package Sidebar

Install

npm i @aegenet/belt-string-split

Weekly Downloads

74

Version

2.3.0

License

MIT

Unpacked Size

15.9 kB

Total Files

7

Last publish

Collaborators

  • agenet