Giter Club home page Giter Club logo

string-case-change's Introduction

string-case-change

A lightweight JavaScript package for converting strings between different casing styles such as lowercase, uppercase, title case, and sentence case.

Usage

// Importing the class
const stringCaseChange = require('string-case-change');

// Example usage
const myString = "heLlo woRld";

console.log('Lower case: ' + stringCaseChange.toLowerCase(myString)); // Lower case: hello world
console.log('Upper case: ' + stringCaseChange.toUpperCase(myString)); // Upper case: HELLO WORLD
console.log('Title case: ' + stringCaseChange.toTitleCase(myString)); // Title case: Hello World
console.log('Sentence case: ' + stringCaseChange.toSentenceCase(myString)); // Sentence case: Hello world
console.log('Camel case: ' + stringCaseChange.toCamelCase(myString)); // Camel case: helloWorld
console.log('Snake case: ' + stringCaseChange.toSnakeCase(myString)); // Snake case: hello_world
console.log('Kebab case: ' + stringCaseChange.toKebabCase(myString)); // Kebab case: hello-world
console.log('Pascal case: ' + stringCaseChange.toPascalCase(myString)); // Pascal case: HelloWorld
console.log('Constant case: ' + stringCaseChange.toConstantCase(myString)); // Constant case: HELLO_WORLD
console.log('Dot case: ' + stringCaseChange.toDotCase(myString)); // Dot case: hello.world
console.log('Path case: ' + stringCaseChange.toPathCase(myString)); // Path case: hello/world
console.log('Alternating case: ' + stringCaseChange.toAlternatingCase(myString)); // Alternating case: HeLlO WoRlD
console.log('Inverted case: ' + stringCaseChange.toInvertedCase(myString)); // Inverted case: HElLO WOrLD
console.log('Sponge case: ' + stringCaseChange.toSpongeCase(myString)); // Sponge case: HeLLo worLD
console.log('Reverse case: ' + stringCaseChange.toReverseCase(myString)); // Reverse case: DLrOW OLlEH
console.log('Small caps case: ' + stringCaseChange.toSmallCaps(myString)); // Small caps case: hello world
console.log('Mirrored case: ' + stringCaseChange.toMirroredCase(myString)); // Mirrored case: plᴚoʍ ol⅂ǝɥ

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.