Sha256: b0104d7f6246482d7d387900128253e91e329d140d3b936f2d4e79fbd7a04023

Contents?: true

Size: 289 Bytes

Versions: 264

Compression:

Stored size: 289 Bytes

Contents

module PhoneNumber

open System

let parsePhoneNumber (input: string) = 
    let digits = input.ToCharArray() |> Array.filter (Char.IsDigit) |> String

    match digits.Length with
    | 10 -> Some digits
    | 11 when digits.Chars 0 = '1' ->  Some (digits.Substring(1))
    | _ -> None

Version data entries

264 entries across 264 versions & 1 rubygems

Version Path
trackler-2.2.1.46 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.45 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.44 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.43 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.42 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.41 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.40 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.39 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.38 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.37 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.36 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.35 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.34 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.33 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.32 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.31 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.30 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.29 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.28 tracks/fsharp/exercises/phone-number/Example.fs
trackler-2.2.1.27 tracks/fsharp/exercises/phone-number/Example.fs