Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
extension CollectionType
{
/**
Construye una cadena de texto con los elementos contenidos
- parameter separator: Un caracter que se emplea para separar los elementos
*/
func descriptionWithSeparator(separator: String) -> String
{
return self.reduce(String())
{
if String($0).isEmpty
{
return String($1)
}
else
{
return "\(String($0))\(separator)\(String($1))"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.