0.1.15 • Published 3 years ago

string-method v0.1.15

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

string-method V0.1.15

The string-method library provides access to string properties and methods that are not available for the native string in javascript.

Installation

Using npm:

$ npm i -g string-method
$ npm i string-method

Note: add --save if you are using npm < 5.0.0

Using yarn:

$ yarn global add string-method
$ yarn add string-method

Usage:

const { capitalize } = require('string-method');

// call a method from module
console.log(capitalize('my sTring')); //My String

or import one method individually (not working well)

const toCamelCase = require('string-method/toCamelCase');

// call a method from module
console.log(toCamelCase('to-camel-case')); //toCamelCase

Available Methods

MethodDescription
capitalizechanges the first letter of all words in string to upper case and the rest in lower case
reversereverses the order of the characters in a string
reverseWordreverses the order of the words in a string
isUpperCasechecks if a word is in upper case
isLowerCasechecks if a word is in lower case
toCamelCasechanges a word in any order to camel case notation
isPalindromechecks if a string is the same in reverse order
areEqualchecks if two strings are equal
areEqualIgnoreCasechecks if two strings are equal but ignoring the case
compareManycompares any number of strings passed as parameters. Returns true if they are equal otherwise false is returned
compareManyIgnoreCasecompares any number of strings passed as parameters but ignoring the case. Returns true if they are equal otherwise false is returned
containschecks if a string contains another string
countchecks the number of times a specified value occurs in a string
countCharactersreturns occurences of each character in a string
countRepetitionsreturns letters of a string with its repetition times
isEmptychecks whether a string is empty or not
slugifymakes a slug from a string
removeDuplicatesremoves duplicate words from a string
isSpacechecks whether all string characters are spaces
isDigitchecks whether all string characters are digits
isAlphachecks whether all string characters are alphabetical characters
isAlphaNumericchecks whether all string characters are alphanumeric characters
longestCombinationreturns longest possible sorted combination of strings containing distinct letters in lowercase
toAlternatingCasereturns a new string with each lowercase letter changed to uppercase and each uppercase letter changed to lowercase
hasSpacesreturns true if a string contains one or more spaces otherwise it returns false
countWordsreturns number of words in a string
countConsonantsreturns number of consonants in a provided string
countVowelsreturns number of vowels in a provided string
startsWithreturns true if the first string starts with the provided second string otherwise returns false
countSpacesreturns the number of spaces in a string
toTitleCasechanges the string to title case by capitalizing all words in the string except non-starting prepositions
removeSpacesremoves all spaces in a string
containsEmojichecks if a string contains emoji or not

We are adding others day by day.

Development

Visit our github repository here. Any suggestion or improvement on this library is welcome.

Contributing

Before contributing to this library read this guide. We'll love getting new idea from you.

0.1.15

3 years ago

0.1.14

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago