Skip to content

Instantly share code, notes, and snippets.

@StanislavK
Created June 1, 2015 08:55
Show Gist options
  • Save StanislavK/20ae9e0fa7676bad5beb to your computer and use it in GitHub Desktop.
Save StanislavK/20ae9e0fa7676bad5beb to your computer and use it in GitHub Desktop.
extension Array {
func combine(separator: String) -> String{
var str : String = ""
for (idx, item) in enumerate(self) {
str += "\(item)"
if idx < self.count-1 {
str += separator
}
}
return str
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment