An extension of the String class in Javascript. Using Prototype Oriented Programming; methods, procedures and instance attributes are added to the String class to support more string manipulation features.
- Javascript ES6 (ECMAScript 2015)
- Node JS
- Mocha
- Travis CI
- Coveralls
- Hound CI
- Istanbul Test Coverage Generator
The following methods were added:
-
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
- Clone the repository into your local machine
git clone https://github.com/andela-oaladeusi/string-class.git
- Navigate to string-class
cd string-class
- Run
npm install
to install all the dependencies. - To start string-class app
npm start
- To run tests
npm test
- Move the string-class.js file, located in the "src" directory, into any project directory you wish to use it in.