string-left-number-right

Check if the string contains letters on the left and numbers on the right side

Usage no npm install needed!

<script type="module">
  import stringLeftNumberRight from 'https://cdn.skypack.dev/string-left-number-right';
</script>

README

string-left-number-right Build Status

Check if a string contains letters on the left and numbers on the right side

Install

$ npm install string-left-number-right

Usage

const stringLeftNumberRight = require('string-left-number-right');

stringLeftNumberRight('orange8888');
//=> true

stringLeftNumberRight('orange');
//=> false

stringLeftNumberRight('8888orange');
//=> false

stringLeftNumberRight('8888');
//=> false

stringLeftNumberRight('orange8888abc');
//=> false

stringLeftNumberRight(8888);
//=> undefined

Note: This module doesn't consider whitespace. Please consider trim the string beforehand.

License

MIT © JeffMinsungKim