Last active
August 29, 2015 14:18
-
-
Save wanbok/ce854325a471dd15cc1e to your computer and use it in GitHub Desktop.
Swift, Joining (Implicitly Unwrapped) Optional Strings with a joiner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
func join(strings: String!... ) -> String { | |
return self.join(strings.filter({ $0?.isEmpty == false }).map {$0 as String}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using like this: