1.1.10 • Published 3 years ago

extract-last-number v1.1.10

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

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.