1.0.4 • Published 4 years ago

parsestr-numarr v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

parsestr-numarr

1) Converts an array of numbers(in String) to number (eg. convertStrToArrNum('1','2,'text') => 1,2,'text') 2) Converts a string which we split with given value where the string in digits are converted to digits (eg. convertStrToArrNum('9 23 3 52 da2 2sd 10', ' ') => 9,23,3,52,'da2','2sd',10) --which splits the array by space(' ') and also converts the Number(In string) to Number

Main Advantage: while calculating for the Mean, Median etc... so we need to add the values in the array, but sometimes we failed to see whether the given element in the array is string or number(Especially when dealing with large number of array values or large number of values in string which we need to split manually and add it ---> for that kind of purpose it will be very helpful)

Installation

Install via NPM:

npm install parsestr-numarr

Usage

javascript

var myApp = require("parsestr-numarr");

myApp.convertstrtoarrnum(); // print and return Array of Numbers"  

TypeScript

import * as myApp from 'parsestr-numarr';

myApp.convertstrtoarrnum(); // print and return Array of Numbers" 

License

This project is licensed under the terms of the MIT license.