The source code to convert a string into Uppercase.is given below. The given program is compiled and executed successfully.
# Ruby program to convert a
# string into Uppercase
str = "Hello";
uStr = str.upcase();
print "Uppercase string: ",uStr;
Output:
Uppercase string: HELLO
Explanation:
In the above program, we created a string str initialized with "Hello". Then we used the upcase() method to convert the string into uppercase and return the updated string. After that, we print an updated string.
Program/Source Code:
The source code to convert a string into Uppercase.is given below. The given program is compiled and executed successfully.
Output:
Explanation:
In the above program, we created a string str initialized with "Hello". Then we used the upcase() method to convert the string into uppercase and return the updated string. After that, we print an updated string.
need an explanation for this answer? contact us directly to get an explanation for this answer