From: "Jan E." Date: 2012-07-04T03:02:40+09:00 Subject: Re: Remove vowels from a string Hi, Or a bit more straightforward: str.delete 'aeiouAEIOU' Joao Silva wrote in post #1067214: > I'm trying to make a program that removes all the vowels in a string > entered, but no I'm doing wrong. This is the code I am doing: Ruby is not Java or C! You should get rid of this lowlevel programming style and take a more highlevel approach. It's very rare in Ruby that you actually have to build a string character by character in a loop. There's almost always a more intelligent way to do this (like String#delete or String#gsub in this case). Apart from that, you shouldn't use the "for" loop. It's just ugly and has the disadvantage of not creating a new scope (i. e. the loop variable is accessible from the outside). Use an iterator like String#each_char. -- Posted via http://www.ruby-forum.com/.