string-checker-lib
v1.0.13
Published
Library for Stringmanipulation
Downloads
1
Readme
My first npm package with String test Functions
Function-List:
StringNotEmpty(str) - Test (empty,null, only whitespace or undefined) String
RemoveWhitespace(str) - Remove all Whitespace in String
csv2array(str,char=',') - CSV String to array
array2csv(arr,char=',') - Array back to CSV String
getNumbersArray(str) - Extracts all numbers from the string and returns an array
Installation:
npm install string-checker-lib
Usage:
var str = require('string-checker-lib');
var nmixed = " AA20c6/#600MM1000-+'<55>'";
var a = str.getNumbersArray(nmixed);
a.forEach(function(ele,index) {
console.log(index+":"+ele);
});
output:
0:20
1:6
2:600
3:1000
4:55