As I understand in initial message, string should be splitted by spaces, not all kind of whitespaces(like TAB). whiteCharacterSet() is not just space(at least TAB char there too). So, if we need split just by space we need some componentsSeparatedBySpaceCharacter(). And IMO this is not a good solution.

Actually "a b c".componentsSeparatedByString(" ") works well, but probaly it will be good to have something like "a:b-->c/d".componentsSeparatedByStrings(":", "-->", "/"). But I'm not sure about this :-)

On 08.04.2016 19:38, Ross O'Brien via swift-evolution wrote:
A function that splits by whitespace would be this:

"h j c
k".componentsSeparatedByCharactersInSet(NSCharacterSet.whiteCharacterSet())

'componentsSeparatedByWhitespace' might be a nice addition as a shortcut
for that though?
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to