Giter Site home page Giter Site logo

devathul-88 / string-dooku Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 19 KB

A tiny npm package to perform basic string methods

Home Page: https://www.npmjs.com/package/string-dooku

JavaScript 100.00%
package npm nodejs node javascript string strings-manipulation

string-dooku's Introduction

String-Dooku

A tiny npm package to perform basic string methods

It's so easy to get started with this package. Follow the steps below

// import the package 
const str = require("string-dooku")

// create a new instance of the function
const ins = new str()

// change string case to upper
console.log(ins.toUpperCase("hello world")) // output: -> HELLO WORLD

// reverse a string
console.log(ins.reverse("Hello World")) // output -> dlroW olleH

// check substring -- we need to pass two parameters so this function will check the first argument of the function same as the second one then it will return a boolean value
console.log(ins.checkSubstring("app" , "app")) // output -> true

// duplication count
console.log(app.duplicationCount("Hello World")); // output -> { H: 1, e: 1, l: 4, o: 2, ' ': 1, W: 1, r: 1, d: 1 }

And there are so many other function methods

// import the package 
const str = require("string-dooku")

// create a new instance of the function
const ins = new str()

// change case to UpperCase
console.log(ins.toUpperCase("Hello World")) // output -> HELLO WORLD

// change case to lowercase
console.log(ins.toLowerCase("Hello World")) // output -> hello world

// change the case to pascal case
console.log(ins.toPascalCase("Hello World")) // output -> HelloWorld

// change the case to snake case
console.log(ins.toSnakeCase("Hello World")) // output -> hello_world

// change the case to dot case
console.log(ins.toDotCase("Hello World")) // output -> hello.world

// change the case to space case
console.log(ins.toSpaceCase("Hello World")) // output -> H e l l o   W o r l d

// change the case to title case
console.log(ins.toTitleCase("hello world")) // output -> Hello World

// get the total length of the string
console.log(ins.length("Hello World")) // output -> 11

// check the if first argument is same as the second argument
console.log(ins.checkValue("Hello" , "Hello")) // output -> true

// duplication count of the each word in the string
console.log(app.duplicationCount("Hello World")); // output -> { H: 1, e: 1, l: 4, o: 2, ' ': 1, W: 1, r: 1, d: 1 }

// reverse a string
console.log(ins.reverse("Hello World")) // output -> dlroW olleH

// its is same as checkValue. both function check if the first argument is same as the second argument
console.log(ins.checkSubstring("app" , "app")) // output -> true

// check the longest string
console.log(ins.longestWord("Hello World")) // output -> Hello

// convert to string
console.log(typeof ins.toString([1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ])); // output -> string

// convert to string into a array
console.log(ins.toArray("Hello World")); // output -> [ 'Hello', 'World' ]

// to returns the character from the specified index.
console.log(ins.characterAt("Hello World" , 2); // output -> l

// this function determines whether a string ends with the characters of a specified string, returning true or false as appropriate.
console.log(ins.endsWith("Hello World" , "World")); // output -> true

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/string-dooku)
  3. Commit your changes (git commit -am 'First commit')
  4. Push to the branch (git push origin feature/string-dooku)
  5. Create a new Pull Request

string-dooku's People

Stargazers

 avatar

Watchers

 avatar

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.