@dr-package/only-numbers
TypeScript icon, indicating that this package has built-in type declarations

0.10.8-alpha.2 • Public • Published

Only Numbers

Remove todos os caracteres não numerais de uma string.

Use uma das opções:

const result = onlyNumbers(12312312312);
console.log(result); /// 12312312312

const result = onlyNumbers('1231z312x12');
console.log(result); /// 123131212

const result = onlyNumbers('abc');
console.log(result); /// ''

const result = onlyNumbers('abc', true);
console.log(result); /// NaN

Readme

Keywords

none

Package Sidebar

Install

npm i @dr-package/only-numbers

Weekly Downloads

2

Version

0.10.8-alpha.2

License

UNLICENSED

Unpacked Size

1.3 kB

Total Files

4

Last publish

Collaborators

  • doutorspace