split-numeric
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

Split-Numeric

travis build
A javascript library that splits a string into an array containing all leading numeric digits as one value and the rest (non-numeric) of the string as the second value.

How To Use

1. Install

npm install split-numeric

2. Import

    // ES6 import
    import { split as splitNumeric } from 'split-numeric';

    // Older versions
    const splitNumeric = require('split-numeric').split;

3. Make use (Examples)

    console.log(splitNumeric("20pt10"));
    // ['20', 'pt10']
    
    console.log(splitNumeric("pt10"));
    // ['', 'pt10']

    console.log(splitNumeric("01"));
    // ['01', '']

    console.log(splitNumeric("300,5"));
    // ['300', ',5']

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i split-numeric

    Weekly Downloads

    2

    Version

    1.3.0

    License

    MIT

    Unpacked Size

    12 kB

    Total Files

    11

    Last publish

    Collaborators

    • ioedeveloper