# phoneutils-libphonenumber **Repository Path**: ghink_archive/phoneutils-libphonenumber ## Basic Information - **Project Name**: phoneutils-libphonenumber - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-23 - **Last Updated**: 2026-04-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README phoneutils ============== Go port of Google's libphonenumber forked from https://github.com/ttacon/libphonenumber which is fully stable and is used in production by several companies. Examples ======== Super simple to use. ### To get a phone number ```go num, err := phoneutils.Parse("6502530000", "US") ``` ### To format a number ```go // num is a *phoneutils.PhoneNumber formattedNum := phoneutils.Format(num, phoneutils.NATIONAL) ``` ### To get the area code of a number ```go // Parse the number. num, err := phoneutils.Parse("1234567890", "US") if err != nil { // Handle error appropriately. } // Get the cleaned number and the length of the area code. natSigNumber := phoneutils.GetNationalSignificantNumber(num) geoCodeLength := phoneutils.GetLengthOfGeographicalAreaCode(num) // Extract the area code. areaCode := "" if geoCodeLength > 0 { areaCode = natSigNumber[0:geoCodeLength] } fmt.Println(areaCode) ```