Skip to content

Instantly share code, notes, and snippets.

@StanislavK
Created June 1, 2015 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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