Skip to content

DrakeVorndran/StringFunctionsLib

Repository files navigation

npm bundle size npm Snyk Vulnerabilities for npm package Coveralls github Build Status

String Casing

Various functions to handle string casing added onto the string prototype

Functions

  • String.prototype.capatlize())
    Capatlizes the first char of the string and returns it.

    "this is a string".capatlize() //=> "This is a string" 
  • String.prototype.lower())
    Opposite of capatlize, makes the first char lower case.

    "This is a String".lower() //=> "this is a String" 
  • String.prototype.capatlizeSentence())
    Capatlizes each word in the string

    "this is a string".capatlizeSentence() //=> "This Is A String" 
  • String.prototype.evenCaps())
    Capatlizes every other letter in the string on the even

    "this is a string".evenCaps() //=> "ThIs iS A StRiNg"
  • String.prototype.oddCaps())
    Capatlizes every other letter in the string on the odd

    "this is a string".oddCaps() //=> "tHiS Is a sTrInG"
  • String.prototype.removeWhitespace())
    Removes all spaces from a string

    "this is a string".removeWhitespace() //=> "thisisastring"
  • String.prototype.removeExtraWhitespace())
    Remove whitespace from the ends of the string as well as extra spaces in-between words

    "   this  is a    string   ".removeExtraWhitespace() //=> "this is a string"
  • String.prototype.kabobCase()
    changes string from sentence into kabob case

    "this is a string".kabobCase() //=> "this-is-a-string"
  • String.prototype.snakeCase()
    changes string from sentence into snake case

    "this is a string".snakeCase() //=> "this_is_a_string"
  • String.prototype.camelCase()
    changes string from sentence into camel case

    "this is a string".camelCase() //=> "ThisIsAString"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published