Skip to content

Instantly share code, notes, and snippets.

@DaveHogan
Last active January 2, 2016 20:29
Show Gist options
  • Select an option

  • Save DaveHogan/8356779 to your computer and use it in GitHub Desktop.

Select an option

Save DaveHogan/8356779 to your computer and use it in GitHub Desktop.
FSharp recursion example - repeatString
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