I'm having trouble with exercise 4...because I am perhaps being absentminded and can't remember how to print the length of a string. So, out of frustration, I tried "words.length" and obviously it didn't work, but it was worth a shot.
Here's what I have:
puts "Your input here:" text = gets.chomp puts "Your other input here:" redact = gets.chomp words = text.split(" ") words.each do |x| x = words.length print x end
I know that wouldn't even work, but basically...I'm not sure how to get it to print each of the words without turning it into an array. Is that what I have to do? How do you have it go through the array afterwards?