Skip to content

rlyons21/ruby-prompt__strings

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Prompt - Ruby

Strings

Objectives

  1. Learn about strings in Ruby.

Instructions

Research and then write answers to the following questions in lib/strings.md.

  • What is a String?
  • What are some examples of information that would be Strings as opposed to some other data type?
  • What is one way, using Ruby, to retrieve the 6th character in a String like "Ada Lovelace"? How about the 8th character? What happens if you try to retrieve the value of the 99th character (Or any character that doesn't exist)?
  • The previous question asks about finding, for example, the 6th character in a String. Is it possible to find the -6th (Notice the negative symbol!) character in a String? What does that even mean?
  • What is one way, using Ruby, to replace certain characters in a string with some other set of characters? For example, given "Sumeet Jain", how would you replace all of the e characters in my name with exclamation marks? (So it would be "Sum!!t Jain".)

Remember two things:

  1. You don't need to submit any code to us for this assignment. Just provide in-your-own-words answers for the questions above.
  2. We're not looking for any kind of advanced writing skills nor any kind of length. Just be clear and thoughtful about what you write--organize it however it makes sense for you.

Resources

As always, one resource is Google. Some of the questions above can by entered verbatim into a Google search, and for others that won't be as effective. Either way, expect to read (or watch videos) about more than just the simple answer to each question. Often a question's answer--even one that seems short or simple--doesn't really make sense until after you've read the paragraphs before and after it.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published