Sha256: 799c7e43835c2c280c786d78b158fd939a0e61406869ae72b11be21f2a6c859d
Contents?: true
Size: 490 Bytes
Versions: 132
Compression:
Stored size: 490 Bytes
Contents
module PhoneNumber open System let private validate (input: string) = let isStartDigit digit = List.contains digit ['2'..'9'] if isStartDigit input.[0] && isStartDigit input.[3] then Some input else None let clean (input: string) = let digits = input.ToCharArray() |> Array.filter (Char.IsDigit) |> String match digits.Length with | 10 -> validate digits | 11 when digits.Chars 0 = '1' -> validate (digits.Substring(1)) | _ -> None
Version data entries
132 entries across 132 versions & 1 rubygems