---
title: PhoneNumberParser
summary: API reference for PhoneNumberParser.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# PhoneNumberParser

Parses a free-form phone-number string into a `ComponentizedPhoneNumber` (area code/prefix/number), first stripping common punctuation (`(`, `)`, `-`, `.`) and confirming the remaining digits form a valid 10-digit numeric string before splitting it.

## Purpose
- Validates whether a given string, once punctuation is stripped, represents a parseable 10-digit US phone number.
- Splits a valid 10-digit phone number into area code, prefix, and subscriber-number components.

## Context
- Namespace: `SAIF.Services.Utilities`
- Assembly/package: `SAIF.Services` (packaged inside the `SAIF.SAIFCode.Core` NuGet package)

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| PhoneNumberParser(...) | `public PhoneNumberParser(string phoneNumber)` | Stores the raw phone-number string to be parsed. |
| Parse | `public ComponentizedPhoneNumber Parse()` | Returns the phone number split into area code/prefix/number when `CanParse()` succeeds, otherwise returns null. |
| CanParse | `public bool CanParse()` | Returns true when the de-formatted (punctuation-stripped) phone number is exactly 10 numeric characters. |

## Behavioral notes
- De-formatting strips only `(`, `)`, `-`, and `.` characters — other non-numeric characters (e.g., spaces or letters) would cause `CanParse()` to fail the `double.TryParse` check.

## Sources
- Services/SAIF.Services/Utilities/PhoneNumberFormatter.cs
