react-native-country-calling-code-extractor

1.0.4 • Public • Published

react-native-country-calling-code-extractor

A React Native library for extracting country calling codes and phone numbers without country codes, simplifying international phone number management in your app.

Installation

You can install this package via npm or yarn.

npm install react-native-country-calling-code-extractor
# or
yarn add react-native-country-calling-code-extractor

Usage

Import the library into your React Native project:

import { extractCallingCodeAndNumber } from "react-native-country-calling-code-extractor";
Extracting Country Calling Code and Number

To extract the country calling code and the phone number without the country code using your custom function:

import { extractCallingCodeAndNumber } from "react-native-country-calling-code-extractor";

const phoneNumber = "+1xxxxxxxxxx";
const { callingCode, numberWithoutCallingCode } =
  extractCallingCodeAndNumber(phoneNumber);

console.log("Calling Code:", callingCode);
console.log("Phone Number without Country Code:", numberWithoutCallingCode);

License This library is licensed under the MIT License.


Package Sidebar

Install

npm i react-native-country-calling-code-extractor

Weekly Downloads

0

Version

1.0.4

License

ISC

Unpacked Size

475 kB

Total Files

5

Last publish

Collaborators

  • sujeet_thakur