Skip to content

Instantly share code, notes, and snippets.

@toburger
Last active January 2, 2016 19:29
Show Gist options
  • Save toburger/8350403 to your computer and use it in GitHub Desktop.
Save toburger/8350403 to your computer and use it in GitHub Desktop.
/// Removes Diacritics (tilde, cédille, umlaut and friends) from String
let removeDiacritics (s: string) =
s.Normalize(NormalizationForm.FormD)
|> Seq.filter (fun c -> CharUnicodeInfo.GetUnicodeCategory c <> UnicodeCategory.NonSpacingMark)
|> Seq.fold (fun (sb: StringBuilder) c -> sb.Append c) (StringBuilder())
|> string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment