Created
September 11, 2011 20:13
-
-
Save ga2arch/1210059 to your computer and use it in GitHub Desktop.
Scala exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Apple1 extends App { | |
val vowels = Array('a', 'e', 'i', 'o', 'u') | |
println("Type a phrase") | |
val phrase = Console.readLine().toLowerCase | |
val vowel = phrase.find(vowels.contains(_)).getOrElse() | |
val newP = phrase.map(x => if (vowels.contains(x)) vowel else x).mkString | |
println(newP) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment