string-equal

1.0.6 • Public • Published

string-equal

What is it?

'string-equal' It's a simple and very tiny library that allows compare two string with and without case sensitive.

Getting started

Installation

npm i string-equal

Importing

require('string-equal'); //commonJs

Usage

console.log("Hello".equal("Hello")) // output: true
console.log("HELLO".equal("hello")) // output: false
console.log("HELLO".ignoreCaseEqual("hello")) // output: true

Available functions

I extended the String prototype to add a few functions to compare the strings.

String.ignoreCaseEqual(string)

Compare the strings ignoring case. It mean that if we compare "XX" with "xx" it will return TRUE.

console.log("HELLO".ignoreCaseEqual("hello")) // output: true

String.equal(string)

It recibe a string as a param, and it make a simple comparison using ===. It's case sensitive, it mean that if you are comparing "XX" against "xx" i will return FALSE.

console.log("xx".equal("xx")) // output: true
console.log("XX".equal("xx")) // output: false

Package Sidebar

Install

npm i string-equal

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

4.05 kB

Total Files

3

Last publish

Collaborators

  • carvalfer1