Skip to content

Instantly share code, notes, and snippets.

@kjnilsson
Created February 9, 2015 11:27
Show Gist options
  • Save kjnilsson/2efe5457756ecccfcce1 to your computer and use it in GitHub Desktop.
Save kjnilsson/2efe5457756ecccfcce1 to your computer and use it in GitHub Desktop.
let countChar (c:char) (s:string) =
let mutable length = s.Length
let mutable k = 0
while (length <- length - 1; length >= 0) do
if s.[length] = c then k <- k + 1
k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment