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.159 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.158 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.157 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.156 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.155 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.154 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.153 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.152 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.151 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.150 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.149 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.148 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.147 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.146 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.145 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.144 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.143 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.142 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.141 tracks/fsharp/exercises/acronym/Example.fs
trackler-2.2.1.140 tracks/fsharp/exercises/acronym/Example.fs