iOS Closures in Swift First Class Functions Higher Order Functions

john lau
john lau
3,471 Points

seems to be an issue with value.caracters

can't pass it

functions.swift
// Enter your code below

extension String {
func transform(_ character:(String) -> String) -> String {

func removeVowels(from value: String) -> String {
let vowels: [Character] = ["a", "e", "i", "o", "u"]
var newString: String = ""

for character in value.characters {
    if vowels.contains(character) {
        newString.append(character)
    }
}

return newString
}

return character(self)
}
}