Created
July 12, 2015 23:47
-
-
Save jweinst1/4fc033b0ab8a4218476b to your computer and use it in GitHub Desktop.
Function that returns a string of all the same characters.
This file contains 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
# simple stringer function using while loop | |
func stringer(char: String, len: Int) -> String { | |
var chain = char | |
while count(chain) < len { | |
chain += char | |
} | |
return chain | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment