You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple cross-platform offline .NET library for getting Global Country Data without making any HTTP calls.
2
+
<!-- logo -->
3
+
4
+

5
5
6
6
7
7
|||
@@ -20,6 +20,7 @@ A simple cross-platform offline .NET library for getting Global Country Data wit
20
20
- 🗺️ Get country region by ISO 3166 country code
21
21
- ☎️ Get country phone code by ISO 3166 country code
22
22
23
+
23
24
### Install Library
24
25
##### Package Manager
25
26
```cSharp
@@ -42,6 +43,26 @@ For more detailed instructions and comprehensive information about the library,
42
43
43
44
44
45
46
+
47
+
### Methods and Descriptions
48
+
49
+
The CountryData.Standard library provides a set of methods that allow you to retrieve country data, flags, regions, and phone codes. The following table lists the available methods and their descriptions.
50
+
51
+
| Method | Description |
52
+
|--------|-------------|
53
+
|[`GetCountryData()`](./docs/README.md)| Returns all country data including region, short code, and country name. |
54
+
|[`GetCountryByCode(string shortCode)`](./docs/README.md)| Returns a single country's data by its short code. |
55
+
|[`GetCountryEmojiFlag(string shortCode)`](./docs/README.md)| Gets the flag of the country, represented as an emoji, by the country's short code. |
56
+
|[`GetRegionByCountryCode(string shortCode)`](./docs/README.md)| Selects and returns a list of regions for a particular country identified by its short code. |
57
+
|[`GetCountries()`](./docs/README.md)| Gets the list of all country names. |
58
+
|[`GetPhoneCodeByCountryShortCode(string shortCode)`](./docs/README.md)| Returns a single country's phone code by its short code. |
59
+
|[`GetCountryByPhoneCode(string phoneCode)`](./docs/README.md)| Returns country data for the country associated with the specified phone code. |
60
+
|[`GetCurrencyCodesByCountryCode(string shortCode)`](./docs/README.md)| Returns a list of currency codes for a specific country identified by its short code. |
61
+
|[`GetCountryByCurrencyCode(string currencyCode)`](./docs/README.md)| Returns a list of countries that use the specified currency code. |
62
+
|[`GetCountryCode(string countryName)`](./docs/README.md)| Returns the country code for a specific country name. |
63
+
64
+
65
+
45
66
### Initialize the Country data object
46
67
47
68
```cSharp
@@ -81,7 +102,7 @@ For more detailed instructions and comprehensive information about the library,
81
102
.ToList();
82
103
```
83
104
84
-
105
+
### Get Country Data by Country Code
85
106
This example demonstrates how to retrieve a country with a specific phone code using the `GetCountryByPhoneCode` method. In this case, we're fetching the country with the phone code "+233".
86
107
87
108
```csharp
@@ -111,7 +132,6 @@ We are committed to fostering a welcoming and respectful community for everyone.
111
132
* Country ShortCode Enums
112
133
113
134
114
-
115
135
### License
116
136
117
137
This project is licensed under the terms of the [LICENSE](LICENSE).
Copy file name to clipboardExpand all lines: docs/README.md
+42-3Lines changed: 42 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,14 +116,14 @@ This method is particularly useful for applications that need to display or anal
116
116
117
117
118
118
119
-
### GetCountryEmojiFlag(string shortCode)
119
+
### GetCountryEmojiFlag(string shortCode)
120
120
121
-
The `GetCountryEmojiFlag()` method is designed to fetch the flag of a specific country using its ISO 3166-1 alpha-2 code. This method provides a simple and effective way to visually represent countries in your application.
121
+
The `GetCountryEmojiFlag()` method is designed to fetch the flag of a specific country using its ISO 3166-1 alpha-2 code. This method provides a simple and effective way to visually represent countries in your application.
122
122
123
123
Here's the method signature in C#:
124
124
125
125
```csharp
126
-
stringGetCountryEmojiFlag(stringshortCode);
126
+
stringGetCountryFlag(stringshortCode);
127
127
```
128
128
129
129
This method returns the em flag of the country corresponding to the provided ISO code. It's particularly useful when you need to display a country's flag in a user interface or in text-based communication.
@@ -159,4 +159,43 @@ Country GetCountryByPhoneCode(string phoneCode);
159
159
This method is particularly useful when you have a phone code and need to retrieve the corresponding country's information. Simply pass the phone code as a string argument, and the method will return a `Country` object filled with relevant data.
The `GetCurrencyCodesByCountryCode()` method is designed to fetch the currency codes used in a specific country using its ISO 3166-1 alpha-2 code. This method returns a `List<string>`, with each string representing a distinct currency code used in the specified country.
This method is particularly useful for applications that need to display or analyze currency data within a specific country. Simply pass the country
174
+
175
+
### GetCountryByCurrencyCode(string currencyCode)
176
+
177
+
The `GetCountryByCurrencyCode()` method is designed to fetch detailed data for a specific country using its currency code. This method returns a `Country` object, providing a wealth of information about the country, including its name, region, flag, and ISO code.
This method is particularly useful when you have a currency code and need to retrieve the corresponding country's information. Simply pass the currency code as a string argument, and the method will return a `Country` object filled with relevant data.
187
+
188
+
189
+
### GetCountryCode(string countryName)
190
+
191
+
The `GetCountryCode()` method is designed to fetch the ISO 3166-1 alpha-2 code for a specific country using its name. This method returns a string containing the country's ISO code, making it easy to identify countries based on their names.
0 commit comments