Halloween Sale: Flat 70% + Addl. 25% Off + 30 Days Extra Lab on all Courses | Use Coupon HS25 in Checkout | Offer Expires In

  Enroll Now

Scala - Assessment - Write function to remove vowels

Let's now write a program which will remove all vowels from a given string.

Here, we will write a scala program whose main class name is Purge having a function named purgeVowels which would take a string as input and return another string with all vowels removed from the input string.

Usage Example:

Purge.purgeVowels("New York") should return "Nw Yrk".

INSTRUCTIONS
  • Switch to Jupyter tab.

  • Write the code in Jupyter.

The program skeleton will look like this. Complete the code of the function in this to remove the vowels from the input string.

object Purge {
   def purgeVowels( str:String ) : String = {
      return .....
   }
}

  • Press Shift+Enter.

  • Test the function with various inputs to make sure that it is returning the outputs as per requirements.

  • Click on "Submit Answer".


No hints are availble for this assesment

Answer is not availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...