
Aananya Vyas
20,157 Pointsit says : Your code could not be compiled. Please click on "Preview" to view the compiler errors. and I cant figure out
i'm confused
extension String {
func transform(_ arguement:(String) -> String) -> String {
return arguement(self)
}
func removeVowels(from value: (String)-> String) -> String {
var output = ""
for char in value.characters {
if !(char == "a" || char == "A" || char == "e" || char == "E" || char == "I" || char == "i" || char == "o" || char == "O" || char == "u" || char == "U") {
output.append(char)
}
}
return output
}
}
1 Answer

Heidi Puk Hermann
33,339 PointsAlmost there! The issue is when you define your function
func removeVowels(from value: (String)-> String) -> String {
you set the variable as a closure, but it should just be a simple string; should look like the following...
func removeVowels(from value: String) -> String {
The rest of your code works fine :)
Aananya Vyas
20,157 PointsAananya Vyas
20,157 PointsThanks alot!!