0.1.10 • Published 6 years ago
okay-string v0.1.10
Play with Strings easily.
This package contains numerous methods which can be used anywhere in your application according to your need by writing a single line of code.
Install
$ npm install --save okay-string
Usage
const okayString = require('okay-string');
console.log(okayString.isPalindrome('bob'));
//=> true
console.log(okayString.isItAnIPAddress('hello world'));
//=> false
.... and other methods are mentioned below:
Methods
Method Name | Description | Return type |
---|---|---|
isItEmpty(str) | Check if the string is empty | boolean |
isItBool(str) | Check if string is true or false | boolean |
isItStartWithLowerCase(str) | Check if string starts with a lowercase letter | boolean |
isItAnIPAddress(address) | Check if entered address is an IP address | boolean |
isItAPalindrome(str) | Check if string is palindrome | boolean |
isAlphabetic(str) | Check if string contains all alphabets | boolean |
isASCII(str) | Check if string contains ASCII characters | boolean |
parseDate(str) | Check if if date is in correct format i.e DD/MM/YYYY | boolean |
equals(str, elem) | Check if both the entered strings are same | boolean |
isHexColor(str) | Check if string is a hex color | boolean |
isItBase64(str) | Check if string is base64 encoded | boolean |
isMD5(str) | Check if string is valid MD5 | boolean |
isAnEmail(str) | Check if string is a valid email | boolean |
isItIncludes(str, sub) | Check if string contains the substring | boolean |
isIMEI(number) | Check if number is valid IMEI | boolean |
isMACAddr(str) | Check if string is valid MAC Address | boolean |
isDataURI(str) | Check if string is a data uri | boolean |
Method Name | Description | Return type |
---|---|---|
getShuffledArray(arr) | Get an array shuffled | array |
getFactorial(n) | Get factorial of a number | number |
getGCD(numb1, numb2) | Get GCD among the two numbers | number |
getRandomNumber(min, max) | Get random number between min & max | number |
License
The project is licensed under the MIT License
Author
This project is made with ❤️ by Idrees Dargahwala