I\'m looking for a function to convert a string of text that is in UpperCase to SentenceCase. All the examples I can find turn the text into TitleCase.
<
A solution in F#:
open System
let proper (x : string) =
x.Split(' ')
|> Array.filter ((<>) "")
|> Array.map (fun t ->
let head = Seq.head t |> Char.ToUpper |> string
let tail = Seq.tail t |> Seq.map (Char.ToLower >> string)
Seq.append [head] tail
|> Seq.reduce (fun acc elem -> acc + elem))
|> Array.reduce (fun acc elem -> acc + " " + elem)