/string-class

Extension of javascript string class to support more string manipulation, using Prototype Oriented Programming, methods, procedures and instance attributes

Primary LanguageJavaScript

Coverage Status Build Status Code Climate Issue Count

string-class

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.

Technology, Dependencies, Services

  • Javascript ES6 (ECMAScript 2015)
  • Node JS
  • Mocha
  • Travis CI
  • Coveralls
  • Hound CI
  • Istanbul Test Coverage Generator

Methods Added

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

How to use

  1. Clone the repository into your local machine git clone https://github.com/andela-oaladeusi/string-class.git
  2. Navigate to string-class cd string-class
  3. Run npm install to install all the dependencies.
  4. To start string-class app npm start
  5. To run tests npm test
  6. Move the string-class.js file, located in the "src" directory, into any project directory you wish to use it in.

Web use

URL: https://class-string.herokuapp.com/