Created
September 13, 2015 02:51
-
-
Save masters3d/d276dc3551c8a8319dd5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func splitStringToArray(inString:String) -> [String]{ | |
return inString.characters.split(isSeparator: { splitAt($0) }).map{String($0)} | |
} | |
func splitAt(characterToCompare:Character, charToSplitAt:String = " !&$%^&,:")-> Bool{ | |
for each in charToSplitAt.characters{ | |
if each == characterToCompare{ | |
return true | |
} | |
} | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment