for example:
var a = [1, 2, 3] // Ints
var s = \",\".join(a) // EXC_BAD_ACCESS
Is it possible to make the join function return \"1,2,3\
And just to make your life more complete, starting from Xcode 8.0 beta 1 in Swift 3 you should NOW use [String].joined(separator: ",")
.
This is the new "ed/ing" naming rule for Swift APIs:
Name functions and methods according to their side-effects
- Those without side-effects should read as noun phrases, e.g. x.distance(to: y), i.successor().
- Those with side-effects should read as imperative verb phrases, e.g., print(x), x.sort(), x.append(y).
- Name Mutating/nonmutating method pairs consistently. A mutating method will often have a nonmutating variant with similar semantics, but that returns a new value rather than updating an instance in-place. Swift: API Design Guidelines