logo image

Ruby program to convert given string to lower case

31


Following program shows you how to convert given string to lower case. In this program we get string from user and convert that string into lower case using .downcase

puts "Please enter the string:"
input = gets.to_s
lowerCase = input.downcase
puts "Given string in lower case: #{lowerCase}"

Output:

Please enter the string:
HELLO WORLD
Given string in lower case: hello world