Skip to content

Instantly share code, notes, and snippets.

@jweinst1
Created July 12, 2015 23:47
Show Gist options
  • Save jweinst1/4fc033b0ab8a4218476b to your computer and use it in GitHub Desktop.
Save jweinst1/4fc033b0ab8a4218476b to your computer and use it in GitHub Desktop.
Function that returns a string of all the same 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