https://github.com/ioedeveloper/split-numeric
A 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.
https://github.com/ioedeveloper/split-numeric
Last synced: about 1 month ago
JSON representation
A 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.
- Host: GitHub
- URL: https://github.com/ioedeveloper/split-numeric
- Owner: ioedeveloper
- License: mit
- Created: 2019-12-17T08:11:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T19:21:45.000Z (over 2 years ago)
- Last Synced: 2025-03-14T12:47:51.694Z (2 months ago)
- Language: TypeScript
- Size: 303 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Split-Numeric
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']
```