Created
September 7, 2016 11:18
-
-
Save extramaster/08a87dd901237069f254c1101e4ac06a to your computer and use it in GitHub Desktop.
Hello World in Swift
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
import Glibc | |
func splitme(a: String) { | |
let a = a.uppercaseString | |
for j in (a.characters.split{$0 == " "}.map(String.init)) { | |
for i in 0...j.characters.count-1 { | |
let jrange = j.startIndex.advancedBy(i)..<j.endIndex | |
let jarray = j[jrange].characters.map {String($0)} | |
print(jarray.joinWithSeparator(" ")) | |
} | |
} | |
} | |
splitme("Hello Swift on Windows") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
333