Sha256: bb1d0dd5ca2903510d5c224b280bfd0a3c73437a240c84a795e8a741759d927e

Contents?: true

Size: 326 Bytes

Versions: 134

Compression:

Stored size: 326 Bytes

Contents

module Acronym
    
open System
open System.Text.RegularExpressions

let abbreviate (phrase:string) =  
    let acronymChar = Char.ToUpperInvariant << Seq.head
    let words = Regex.Matches(phrase, "[A-Z]+[a-z]*|[a-z]+")
    let chars = [|for word in words do yield word.Value |> acronymChar|]        
    new String(chars)

Version data entries

134 entries across 134 versions & 1 rubygems

Version Path
trackler-2.2.1.78 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.77 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.76 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.75 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.74 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.73 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.72 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.71 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.70 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.69 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.68 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.67 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.66 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.65 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.64 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.63 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.62 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.61 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.60 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.59 tracks/fsharp/exercises/acronym/Example.fs