Skip to content

A JavaScript micro library that provides case-insensitive string helpers

License

Notifications You must be signed in to change notification settings

nickuraltsev/ignore-case

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ignore-case

npm version Build Status Coverage Status

A JavaScript micro library that provides case-insensitive string helpers.

Installation

Install using npm:

npm install ignore-case

Example

var ignoreCase = require('ignore-case');
ignoreCase.equals('FOO', 'Foo'); // => true

API

equals(string1, string2)

Returns true if the specified strings are equal, ignoring case; otherwise, false.

includes(string, searchString[, position])

Returns true if string contains searchString, ignoring case; otherwise, false.

startsWith(string, searchString[, position])

Returns true if string starts with searchString, ignoring case; otherwise, false.

endsWith(string, searchString[, position])

Returns true if string ends with searchString, ignoring case; otherwise, false.

indexOf(string, searchString[, position])

Returns the index of the first occurrence of searchString in string, ignoring case, or -1 if searchString is not found.

License

MIT

About

A JavaScript micro library that provides case-insensitive string helpers

Resources

License

Stars

Watchers

Forks

Packages

No packages published