Created
July 4, 2017 22:19
-
-
Save douglasmartins7/69622e20ae68acdd63b76962bbb294b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print "Type the text with s:" | |
user_input = gets.chomp #gets method the object string that capture text user, chomp clean the line | |
user_input.downcase! #downcase method caixa baixa letter | |
if user_input.include? "s" #include if contains letter s return true | |
user_input.gsub!(/s/, "th") #gsub troca o s pelo th | |
else | |
print "Nothing to do here!" | |
end | |
puts "Your string is: #{user_input}" # insert string and variable with type users |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment