Q:

Write a Scala program to convert all the characters to lowercase, uppercase strings

0

Write a Scala program to convert all the characters to lowercase, uppercase strings.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

object Scala_String {

  def main(args: Array[String]): Unit = {
    val str = "The Quick BroWn FoX!";

    // Convert the above string to all lowercase.
    val lowerStr = str.toLowerCase();
    val upperStr = str.toUpperCase();

    // Display the two strings for comparison.
    println("Original String: " + str);
    println("String in lowercase: " + lowerStr);
    println("String in uppercase: " + upperStr);
  }
}

Sample Output:

Original String: The Quick BroWn FoX!
String in lowercase: the quick brown fox!
String in uppercase: THE QUICK BROWN FOX!

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now