Giter VIP home page Giter VIP logo

string-method's Introduction

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

Method Description
capitalize changes the first letter of all words in string to upper case and the rest in lower case
reverse reverses the order of the characters in a string
reverseWord reverses the order of the words in a string
isUpperCase checks if a word is in upper case
isLowerCase checks if a word is in lower case
toCamelCase changes a word in any order to camel case notation
isPalindrome checks if a string is the same in reverse order
areEqual checks if two strings are equal
areEqualIgnoreCase checks if two strings are equal but ignoring the case
compareMany compares any number of strings passed as parameters. Returns true if they are equal otherwise false is returned
compareManyIgnoreCase compares any number of strings passed as parameters but ignoring the case. Returns true if they are equal otherwise false is returned
contains checks if a string contains another string
count checks the number of times a specified value occurs in a string
countCharacters returns occurences of each character in a string
countRepetitions returns letters of a string with its repetition times
isEmpty checks whether a string is empty or not
slugify makes a slug from a string
removeDuplicates removes duplicate words from a string
isSpace checks whether all string characters are spaces
isDigit checks whether all string characters are digits
isAlpha checks whether all string characters are alphabetical characters
isAlphaNumeric checks whether all string characters are alphanumeric characters
longestCombination returns longest possible sorted combination of strings containing distinct letters in lowercase
toAlternatingCase returns a new string with each lowercase letter changed to uppercase and each uppercase letter changed to lowercase
hasSpaces returns true if a string contains one or more spaces otherwise it returns false
countWords returns number of words in a string
countConsonants returns number of consonants in a provided string
countVowels returns number of vowels in a provided string
startsWith returns true if the first string starts with the provided second string otherwise returns false
countSpaces returns the number of spaces in a string
toTitleCase changes the string to title case by capitalizing all words in the string except non-starting prepositions
removeSpaces removes all spaces in a string
containsEmoji checks 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.

string-method's People

Contributors

claranceliberi avatar dependabot[bot] avatar didiermun avatar hirwablessing avatar oreste-abizera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

string-method's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.