From: Joao Silva Date: 2012-07-04T02:22:53+09:00 Subject: Remove vowels from a string Hi all. 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: ########################################################## def remove_vowels(string) vowels = %w{a e i o u A E I O U} str = "" for i in 0..string.length if not string[i]==vowels[i] then str[i]=string[i] end end return str end puts "Enter a string:: " string=gets.chomp.to_s s=remove_vowels(string) puts "Original string: #{string}" puts "String without vowels >> #{s}" ############################################################## Thanks. -- Posted via http://www.ruby-forum.com/.