This application extends javacript's String.prototype
methods
To test this application, run npm test
The following methods have been added to javacript's String.prototype
-
hasVowels: Checks if the argument contains vowels
-
toUpper: Converts the argument to uppercase characters
-
toLower: Converts the argument to lowercase characters
-
ucFirst: Converts the first character of the argument to uppercase
-
isQuestion: Checks if the argument is a question
-
words: Returns the list of words in the specified string as an array
-
wordCount: Counts the number of words in a string
-
toCurrency: Converts the argument to a currency format
-
fromCurrency: Converts the argument in currency format to number
-
inverseCase: Returns the argument passed in with inverted character cases
-
alternatingCase: Returns the argument passed in with alternating character cases
-
getMiddle: Returns the character(s) in the middle of the argument
-
numberWords: Returns the words equivalent of the number passed in.
-
isDigit: Checks if the argument is a single digit
-
doubleCheck: Checks if the string contains double characters
- You should have NodeJs installed on your machine
- Clone this repositry:
git clone [email protected]:andela-aatanda/string-class.git
- Install dependencies with
npm install
- Fork this repositry to your account.
- Clone your repositry:
git clone [email protected]:your-username/string-class.git
- Create your feature branch:
git checkout -b new-feature
- Commit your changes:
git commit -m "did something"
- Push to the remote branch:
git push origin new-feature
- Open a pull request.