splits a string in swift
func splitstr(input: String) -> [String] { return input.componentsSeparatedByString(" ") } splitstr("i love cookies")