Giter VIP home page Giter VIP logo

silly_string's Introduction

Silly String

A string in Ruby is an data type that holds words, numbers, and other characters. A string is just data. This lab is going to be a refresher on how to create and manipulate strings. You'll code your solution in silly_string.rb

You can read about strings and all the methods available here.

NOTE: This lab does not have tests, so the learn command wont work. Instead, just write your code and test it out manually by running ruby silly_string.rb in the command line. If the output looks like it's intended to, you're good to go and can use learn submit to submit your work!

##Challenge:

  1. Create a string that contains your favorite word. It can be in any language!

  2. Using a method built into ruby, capitalize every letter in the string you just created

  3. Now let's make all the characters lowercase in the string "IM NOT SHOUTING"

  4. Using a method built into ruby, count how many letters are in the string "supercalifragilisticexpialidocious"

  5. Now let's add more words to that string, using + just like in math. That's called concatenation. Let's add together to the two strings "wow" and "mom".

  6. Now let's capitalize just the first letter of the sentence "i really like programming"

  7. Let's take the string "Astounding aardvarks, arguably an ancient animal, always ate apples and acorns and artichokes all around Athens, amazing!". We want to use the gsub method to switch all A for O, as well as all a for o. We'll need to chain gsubs.

View Silly String on Learn.co and start learning to code for free.

silly_string's People

Contributors

aankit avatar dfenjves avatar fs-lms-test-bot avatar kthffmn avatar victhevenot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

c19hc

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.