Giter VIP home page Giter VIP logo

node-trim's Introduction

Instructions for students:

Formatting CLI

Create a program that formats and sanitizes strings.

  • Make sure the function is called in an index.js file.

Example of your end result:

$ node index.js "mIAmi   Vice"
Miami Vice

Steps to create your program:

  • Create a Formatting function in formatting.js. This function should: a) Trim whitespace from the beginning and end of the parameter. b) Collapse spaces (ensure only one space appears at a time, no doubles)

    Example output:

    • ' sao tome' => 'sao tome'
    • 'kuala lumpur ' => 'kuala lumpur'
  • In messaging.js write a new function called showHelp.

    • The function should fire if the term --help appears anywhere in the argument list.

    Here is an example:

    $ node index.js "mIAmi   Vice" --help
    How to use this program:
        1. When you input a new string with more than 1 space the program will sanitize it.
        2. If you typed the name of a city without capitalization the program will capitalize it.
        3. If you included a Capitalized letter inside the wrong place of your string the program will sanitize it.
    Miami Vice
  • also in formatting.js write a new function called capitalizeInitial. This function should take a string as a parameter, and return it with only the first letter capitalized.

    Example output:

    • 'europe' => 'Europe'
    • 'BERLIN' => 'Berlin'
    • 'aSIa' => 'Asia'

Bonuses

  • Your program should be able to remove symbols.

Rules

  • This is an individual assignment.
  • Deadline: 30 minutes.
  • Use Git properly

node-trim's People

Contributors

psychas avatar

Watchers

James Cloos avatar Ashok Dudhat avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.