[swift-evolution] Shortcut for creating arrays
narrativium+swift at gmail.com
Fri Apr 8 09:05:55 CDT 2016
Well, you can do this already:
let words = "rats live on no evil star".componentsSeparatedByString(" ")
so I don't know how much a shortcut is needed.
And given '%w' would currently be impossible in Swift as an operator
containing a letter, is there a Swiftier function name or operator for this?
On Fri, Apr 8, 2016 at 2:20 PM, Arsen Gasparyan via swift-evolution <
swift-evolution at swift.org> wrote:
> Hey guys,
> Very often we need to create an array strings. It's a routine task and I
> really like shortcut in Ruby that shortcut makes everyday coding a little
> bit easier and fun:
> words = %w[rats live on no evil star]
> What do you think about adding something like this in Swift?
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution