Last active
January 2, 2016 20:29
-
-
Save DaveHogan/8356779 to your computer and use it in GitHub Desktop.
FSharp recursion example - repeatString
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
| let rec repeatString stringToRepeat numberOfTimesToRepeat = | |
| if numberOfTimesToRepeat = 0 then "" | |
| else | |
| stringToRepeat + (repeatString stringToRepeat (numberOfTimesToRepeat - 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment