Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iknowjavascript/string-class
Extending the String class in Javascript using Prototype Oriented Programming.
https://github.com/iknowjavascript/string-class
Last synced: 5 days ago
JSON representation
Extending the String class in Javascript using Prototype Oriented Programming.
- Host: GitHub
- URL: https://github.com/iknowjavascript/string-class
- Owner: iKnowJavaScript
- Created: 2019-05-06T12:01:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T21:42:08.000Z (almost 2 years ago)
- Last Synced: 2023-03-11T20:39:17.876Z (almost 2 years ago)
- Language: JavaScript
- Size: 556 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# String-Class
[![CircleCI](https://circleci.com/gh/iKnowJavaScript/string-class/tree/master.svg?style=svg)](https://circleci.com/gh/iKnowJavaScript/string-class/tree/master)
Extending the String class in Javascript using Prototype Oriented Programming.
## methods added:
| Methods | Description | Examples |
| -------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| String.prototype.hasVowels | check for vowels (aeiou) in a string and returns `true` of `false` | "good".hasVowels() returns `true` |
| String.prototype.isQuestion | Checks is a string is a valid question nd returns `true` of `false` | "to be or not to be?".isQuestion() returns `true` |
| String.prototype.toUpper | Convert a lowercase string to uppercase without using inbuild uppercase method | "github".toUpper() returns "GITHUB" |
| String.prototype.toLower | Convert an uppercase string to lowercase | "GITHUB".toLower() returns "github" |
| String.prototype.ucFirst | Convert the first character in a string to uppercase | "i am groot".ucFirst() returns "I am groot" |
| String.prototype.words | Used to split the words of a string into an array | "life is good".words() returns ["life","is","good"] |
| String.prototype.wordCount | Returns the number of words in the string | "groot is good".wordCount() returns 3 |
| String.prototype.inverseCase | Used to inverse the character case in a string | "grOOt".inverseCase() returns "GRooT" |
| String.prototype.isDigit | Used to identify single digits | "2".isDigit() returns true |
| String.prototype.alternatingCase | used to alternate the character case in a string with the first character as always lowercase | "Onomatopoeia".alternatingCase() returns "oNoMaToPoEiA" |
| String.prototype.numberToWord | used to convert numbers in a string to their equivalent in words | "325".numberToWord() returns "three two five" |
| String.prototype.fromCurrency | used to convert currency strings to numbers equivalent | "11,111.11".fromCurrency() returns 11111.11 |
| String.prototype.toCurrency | used to convert Strings to currency equivalent | "1000".toCurrency() returns "1,000" |## Testing
Jest was used to test every functionality of this Project.
Feel free to clone and `npm init` to get the feel of the app and `npm test` before adding more functionality if you wish.