var specializationTitles = ["a", "b", "c", "d"]
let outputString = join(" / ", specializationTitles)
got an error:
Cannot invoke
join
with an argument list of type(String, [String])
How to solve this?
let separator = " / "
let outputString = separator.join(specializationTitles)
With Xcode7beta6:
specializationTitles.joinWithString(" / ")
With Xcode7 release version:
specializationTitles.joinWithSeparator(" / ")
In Swift 2.0 ( which is default on Xcode 7), you will have to use, joinWithSeparator
specializationTitles.joinWithSeparator(" / ")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With