Login using Social Account
     Continue with GoogleLogin using your credentials
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".
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".
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
Loading comments...