I understand that I can fallback to the NSString
function componentsSeparatedByString
, and so perhaps this is a nitpick, but one of the things I like about Swift is that it is designed around brevity and short syntax.
I was really hoping I could just: var parts = myString.characters.split("${")
but that function only works for a single Character, not a two Character string. I even tried var parts = myString.characters.split { $0 == "${" }
but that is expecting a single Character as the delimiter and not a full String. :(
Is there an api function that I'm missing or do I need to stick with the the old NSString
bridged functions?