String Exercises
Visit the official documentation for using Ruby Strings. Get very familiar with this page -- you'll be visiting it frequently! Use the examples and explanations on this page to help you do the next step.
Open
pry. Create some strings and try each of the following methods:#length#upcase#downcase#delete#count#gsub#start_with?#reverse
Write a method
#capitalizethat accepts a string as an argument and capitalizes the first letter of the string. Note: Do not use the built in methodString#capitalizecapitalize("yahoo!") == "Yahoo!"Write a method,
#shout_then_whisperthat takes in two strings, and shouts the first part, then whispers the second part. The output should look like this:shout_then_whisper("Hello", "McDouglas") == "HELLO!! ... mcdouglas"Write a method,
#how_long?that accepts a string as an argument. Your method should return a new string in the format:how_long?("I am a sentence :)") == "Your string is 18 characters long"Write a method,
#hyphenifythat accepts a string as an argument. Your method should remove all the spaces and replace them with hyphens.hyphenify("I am a sentence!") == "I-am-a-sentence!"