iOS Closures in Swift First Class Functions Higher Order Functions

Rea Rahhal
PRO
Rea Rahhal
Pro Student 4,732 Points

make sure removeVowels accepts a string and returns a string

don't know what's wrong...

functions.swift
// Enter your code below
extension String {
func transform (_ argument: (String) -> String) -> String {
    return argument(self)
  }

  func removeVowels(from value:String) -> String {

        var output: String = ""
        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

    }
  }