npm.io
1.1.10 • Published 5 years ago

extract-last-number

Licence
MIT
Version
1.1.10
Deps
0
Size
3 kB
Vulns
0
Weekly
0
Stars
6

extractLastNumber

Extract last number from given string. return array with the string without the number, and the number himself

Usage: extractLastNumber(str: string): [string, number]

import { extractLastNumber } from 'extract-last-number'

extractLastNumber('name1')
// Output: ["name", 1]
extractLastNumber('name')
// Output: ["name", null]
extractLastNumber('name01')
// Output: ["name0", 1]

This module exported from utilizes project.

Keywords