extract-last-number
TypeScript icon, indicating that this package has built-in type declarations

1.1.10 • Public • Published

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.

Package Sidebar

Install

npm i extract-last-number

Weekly Downloads

0

Version

1.1.10

License

MIT

Unpacked Size

2.92 kB

Total Files

5

Last publish

Collaborators

  • natqe3