PSC.CSharp.Library.CountryData 8.0.9

dotnet add package PSC.CSharp.Library.CountryData --version 8.0.9                
NuGet\Install-Package PSC.CSharp.Library.CountryData -Version 8.0.9                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PSC.CSharp.Library.CountryData" Version="8.0.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PSC.CSharp.Library.CountryData --version 8.0.9                
#r "nuget: PSC.CSharp.Library.CountryData, 8.0.9"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PSC.CSharp.Library.CountryData as a Cake Addin
#addin nuget:?package=PSC.CSharp.Library.CountryData&version=8.0.9

// Install PSC.CSharp.Library.CountryData as a Cake Tool
#tool nuget:?package=PSC.CSharp.Library.CountryData&version=8.0.9                

Country Data library for NET8

A simple cross-platform offline .NET library for getting country data. The library is based on the ISO-3166-1 standard. Based on the operating system, using Unicode, you can display the flag of the country. On Windows, the emoji displays the shortcode of the country, not the flag.

The library has the flags of the countries in SVG format. The flags can be displayed in two different types: Square and Wide.

Install Library

To install the library in your project, open the Package Manager and type the following command:

Install-Package PSC.CSharp.Library.CountryData

Also, you can use the .NET CLI to install the library. Type the following command:

dotnet add package PSC.CSharp.Library.CountryData

Usage

Here is an example how to use the library in your project.

Initialize the CountryData

// loads all Country Data via the constructor (You can initialize this once as a singleton)
var countryHelper = new CountryHelper();

Get the list of countries

foreach (var country in countries) 
    Console.WriteLine(country);

Get the list of regions in a country by country code

var regions = countryHelper.GetRegionByCountryCode("IT");
foreach (var region in regions)
    Console.WriteLine(region.Name);

Using lambda for custom queries

GetCountryData() returns an IEnumerable<Country> which can be queried with Lambda for a more flexible usage.

var data = countryHelper.GetCountryData();

Get the list of countries by their Names

This code displays the name of the countries using a foreach.

var countries = data.Select(c => c.CountryName).ToList();
foreach (var country in countries)
    Console.WriteLine(country);

Here the code to use Linq to filter the list.

data.Where(x => x.CountryShortCode == "US")
    .Select(r=>r.Regions).FirstOrDefault()
    .ToList();

Get the flag for a country

In the library, I added a method to get the flag of a country. The flags are in SVG format. The type of the flag can be Square or Wide.

var flag = helper.GetFlagByCountryCode("GB", FlagType.Square);

List of supported ISO-3166-1 country codes

Here is the list of supported ISO-3166-1 country codes, their code point pairs and Emoji flags. Based on the operating system, you see different Emoji. In Windows, you see the short name of the country. In iOS and Android, the flag of the correspondent country is displayed.

ISO Emoji Unicode Name
AD ๐Ÿ‡ฆ๐Ÿ‡ฉ U+1F1E6 U+1F1E9 Andorra
AE ๐Ÿ‡ฆ๐Ÿ‡ช U+1F1E6 U+1F1EA United Arab Emirates
AF ๐Ÿ‡ฆ๐Ÿ‡ซ U+1F1E6 U+1F1EB Afghanistan
AG ๐Ÿ‡ฆ๐Ÿ‡ฌ U+1F1E6 U+1F1EC Antigua and Barbuda
AI ๐Ÿ‡ฆ๐Ÿ‡ฎ U+1F1E6 U+1F1EE Anguilla
AL ๐Ÿ‡ฆ๐Ÿ‡ฑ U+1F1E6 U+1F1F1 Albania
AM ๐Ÿ‡ฆ๐Ÿ‡ฒ U+1F1E6 U+1F1F2 Armenia
AO ๐Ÿ‡ฆ๐Ÿ‡ด U+1F1E6 U+1F1F4 Angola
AQ ๐Ÿ‡ฆ๐Ÿ‡ถ U+1F1E6 U+1F1F6 Antarctica
AR ๐Ÿ‡ฆ๐Ÿ‡ท U+1F1E6 U+1F1F7 Argentina
AS ๐Ÿ‡ฆ๐Ÿ‡ธ U+1F1E6 U+1F1F8 American Samoa
AT ๐Ÿ‡ฆ๐Ÿ‡น U+1F1E6 U+1F1F9 Austria
AU ๐Ÿ‡ฆ๐Ÿ‡บ U+1F1E6 U+1F1FA Australia
AW ๐Ÿ‡ฆ๐Ÿ‡ผ U+1F1E6 U+1F1FC Aruba
AX ๐Ÿ‡ฆ๐Ÿ‡ฝ U+1F1E6 U+1F1FD ร…land Islands
AZ ๐Ÿ‡ฆ๐Ÿ‡ฟ U+1F1E6 U+1F1FF Azerbaijan
BA ๐Ÿ‡ง๐Ÿ‡ฆ U+1F1E7 U+1F1E6 Bosnia and Herzegovina
BB ๐Ÿ‡ง๐Ÿ‡ง U+1F1E7 U+1F1E7 Barbados
BD ๐Ÿ‡ง๐Ÿ‡ฉ U+1F1E7 U+1F1E9 Bangladesh
BE ๐Ÿ‡ง๐Ÿ‡ช U+1F1E7 U+1F1EA Belgium
BF ๐Ÿ‡ง๐Ÿ‡ซ U+1F1E7 U+1F1EB Burkina Faso
BG ๐Ÿ‡ง๐Ÿ‡ฌ U+1F1E7 U+1F1EC Bulgaria
BH ๐Ÿ‡ง๐Ÿ‡ญ U+1F1E7 U+1F1ED Bahrain
BI ๐Ÿ‡ง๐Ÿ‡ฎ U+1F1E7 U+1F1EE Burundi
BJ ๐Ÿ‡ง๐Ÿ‡ฏ U+1F1E7 U+1F1EF Benin
BL ๐Ÿ‡ง๐Ÿ‡ฑ U+1F1E7 U+1F1F1 Saint Barthรฉlemy
BM ๐Ÿ‡ง๐Ÿ‡ฒ U+1F1E7 U+1F1F2 Bermuda
BN ๐Ÿ‡ง๐Ÿ‡ณ U+1F1E7 U+1F1F3 Brunei Darussalam
BO ๐Ÿ‡ง๐Ÿ‡ด U+1F1E7 U+1F1F4 Bolivia
BQ ๐Ÿ‡ง๐Ÿ‡ถ U+1F1E7 U+1F1F6 Bonaire, Sint Eustatius and Saba
BR ๐Ÿ‡ง๐Ÿ‡ท U+1F1E7 U+1F1F7 Brazil
BS ๐Ÿ‡ง๐Ÿ‡ธ U+1F1E7 U+1F1F8 Bahamas
BT ๐Ÿ‡ง๐Ÿ‡น U+1F1E7 U+1F1F9 Bhutan
BV ๐Ÿ‡ง๐Ÿ‡ป U+1F1E7 U+1F1FB Bouvet Island
BW ๐Ÿ‡ง๐Ÿ‡ผ U+1F1E7 U+1F1FC Botswana
BY ๐Ÿ‡ง๐Ÿ‡พ U+1F1E7 U+1F1FE Belarus
BZ ๐Ÿ‡ง๐Ÿ‡ฟ U+1F1E7 U+1F1FF Belize
CA ๐Ÿ‡จ๐Ÿ‡ฆ U+1F1E8 U+1F1E6 Canada
CC ๐Ÿ‡จ๐Ÿ‡จ U+1F1E8 U+1F1E8 Cocos (Keeling) Islands
CD ๐Ÿ‡จ๐Ÿ‡ฉ U+1F1E8 U+1F1E9 Congo
CF ๐Ÿ‡จ๐Ÿ‡ซ U+1F1E8 U+1F1EB Central African Republic
CG ๐Ÿ‡จ๐Ÿ‡ฌ U+1F1E8 U+1F1EC Congo
CH ๐Ÿ‡จ๐Ÿ‡ญ U+1F1E8 U+1F1ED Switzerland
CI ๐Ÿ‡จ๐Ÿ‡ฎ U+1F1E8 U+1F1EE Cรดte D'Ivoire
CK ๐Ÿ‡จ๐Ÿ‡ฐ U+1F1E8 U+1F1F0 Cook Islands
CL ๐Ÿ‡จ๐Ÿ‡ฑ U+1F1E8 U+1F1F1 Chile
CM ๐Ÿ‡จ๐Ÿ‡ฒ U+1F1E8 U+1F1F2 Cameroon
CN ๐Ÿ‡จ๐Ÿ‡ณ U+1F1E8 U+1F1F3 China
CO ๐Ÿ‡จ๐Ÿ‡ด U+1F1E8 U+1F1F4 Colombia
CR ๐Ÿ‡จ๐Ÿ‡ท U+1F1E8 U+1F1F7 Costa Rica
CU ๐Ÿ‡จ๐Ÿ‡บ U+1F1E8 U+1F1FA Cuba
CV ๐Ÿ‡จ๐Ÿ‡ป U+1F1E8 U+1F1FB Cape Verde
CW ๐Ÿ‡จ๐Ÿ‡ผ U+1F1E8 U+1F1FC Curaรงao
CX ๐Ÿ‡จ๐Ÿ‡ฝ U+1F1E8 U+1F1FD Christmas Island
CY ๐Ÿ‡จ๐Ÿ‡พ U+1F1E8 U+1F1FE Cyprus
CZ ๐Ÿ‡จ๐Ÿ‡ฟ U+1F1E8 U+1F1FF Czech Republic
DE ๐Ÿ‡ฉ๐Ÿ‡ช U+1F1E9 U+1F1EA Germany
DJ ๐Ÿ‡ฉ๐Ÿ‡ฏ U+1F1E9 U+1F1EF Djibouti
DK ๐Ÿ‡ฉ๐Ÿ‡ฐ U+1F1E9 U+1F1F0 Denmark
DM ๐Ÿ‡ฉ๐Ÿ‡ฒ U+1F1E9 U+1F1F2 Dominica
DO ๐Ÿ‡ฉ๐Ÿ‡ด U+1F1E9 U+1F1F4 Dominican Republic
DZ ๐Ÿ‡ฉ๐Ÿ‡ฟ U+1F1E9 U+1F1FF Algeria
EC ๐Ÿ‡ช๐Ÿ‡จ U+1F1EA U+1F1E8 Ecuador
EE ๐Ÿ‡ช๐Ÿ‡ช U+1F1EA U+1F1EA Estonia
EG ๐Ÿ‡ช๐Ÿ‡ฌ U+1F1EA U+1F1EC Egypt
EH ๐Ÿ‡ช๐Ÿ‡ญ U+1F1EA U+1F1ED Western Sahara
ER ๐Ÿ‡ช๐Ÿ‡ท U+1F1EA U+1F1F7 Eritrea
ES ๐Ÿ‡ช๐Ÿ‡ธ U+1F1EA U+1F1F8 Spain
ET ๐Ÿ‡ช๐Ÿ‡น U+1F1EA U+1F1F9 Ethiopia
FI ๐Ÿ‡ซ๐Ÿ‡ฎ U+1F1EB U+1F1EE Finland
FJ ๐Ÿ‡ซ๐Ÿ‡ฏ U+1F1EB U+1F1EF Fiji
FK ๐Ÿ‡ซ๐Ÿ‡ฐ U+1F1EB U+1F1F0 Falkland Islands (Malvinas)
FM ๐Ÿ‡ซ๐Ÿ‡ฒ U+1F1EB U+1F1F2 Micronesia
FO ๐Ÿ‡ซ๐Ÿ‡ด U+1F1EB U+1F1F4 Faroe Islands
FR ๐Ÿ‡ซ๐Ÿ‡ท U+1F1EB U+1F1F7 France
GA ๐Ÿ‡ฌ๐Ÿ‡ฆ U+1F1EC U+1F1E6 Gabon
GB ๐Ÿ‡ฌ๐Ÿ‡ง U+1F1EC U+1F1E7 United Kingdom
GD ๐Ÿ‡ฌ๐Ÿ‡ฉ U+1F1EC U+1F1E9 Grenada
GE ๐Ÿ‡ฌ๐Ÿ‡ช U+1F1EC U+1F1EA Georgia
GF ๐Ÿ‡ฌ๐Ÿ‡ซ U+1F1EC U+1F1EB French Guiana
GG ๐Ÿ‡ฌ๐Ÿ‡ฌ U+1F1EC U+1F1EC Guernsey
GH ๐Ÿ‡ฌ๐Ÿ‡ญ U+1F1EC U+1F1ED Ghana
GI ๐Ÿ‡ฌ๐Ÿ‡ฎ U+1F1EC U+1F1EE Gibraltar
GL ๐Ÿ‡ฌ๐Ÿ‡ฑ U+1F1EC U+1F1F1 Greenland
GM ๐Ÿ‡ฌ๐Ÿ‡ฒ U+1F1EC U+1F1F2 Gambia
GN ๐Ÿ‡ฌ๐Ÿ‡ณ U+1F1EC U+1F1F3 Guinea
GP ๐Ÿ‡ฌ๐Ÿ‡ต U+1F1EC U+1F1F5 Guadeloupe
GQ ๐Ÿ‡ฌ๐Ÿ‡ถ U+1F1EC U+1F1F6 Equatorial Guinea
GR ๐Ÿ‡ฌ๐Ÿ‡ท U+1F1EC U+1F1F7 Greece
GS ๐Ÿ‡ฌ๐Ÿ‡ธ U+1F1EC U+1F1F8 South Georgia
GT ๐Ÿ‡ฌ๐Ÿ‡น U+1F1EC U+1F1F9 Guatemala
GU ๐Ÿ‡ฌ๐Ÿ‡บ U+1F1EC U+1F1FA Guam
GW ๐Ÿ‡ฌ๐Ÿ‡ผ U+1F1EC U+1F1FC Guinea-Bissau
GY ๐Ÿ‡ฌ๐Ÿ‡พ U+1F1EC U+1F1FE Guyana
HK ๐Ÿ‡ญ๐Ÿ‡ฐ U+1F1ED U+1F1F0 Hong Kong
HM ๐Ÿ‡ญ๐Ÿ‡ฒ U+1F1ED U+1F1F2 Heard Island and Mcdonald Islands
HN ๐Ÿ‡ญ๐Ÿ‡ณ U+1F1ED U+1F1F3 Honduras
HR ๐Ÿ‡ญ๐Ÿ‡ท U+1F1ED U+1F1F7 Croatia
HT ๐Ÿ‡ญ๐Ÿ‡น U+1F1ED U+1F1F9 Haiti
HU ๐Ÿ‡ญ๐Ÿ‡บ U+1F1ED U+1F1FA Hungary
ID ๐Ÿ‡ฎ๐Ÿ‡ฉ U+1F1EE U+1F1E9 Indonesia
IE ๐Ÿ‡ฎ๐Ÿ‡ช U+1F1EE U+1F1EA Ireland
IL ๐Ÿ‡ฎ๐Ÿ‡ฑ U+1F1EE U+1F1F1 Israel
IM ๐Ÿ‡ฎ๐Ÿ‡ฒ U+1F1EE U+1F1F2 Isle of Man
IN ๐Ÿ‡ฎ๐Ÿ‡ณ U+1F1EE U+1F1F3 India
IO ๐Ÿ‡ฎ๐Ÿ‡ด U+1F1EE U+1F1F4 British Indian Ocean Territory
IQ ๐Ÿ‡ฎ๐Ÿ‡ถ U+1F1EE U+1F1F6 Iraq
IR ๐Ÿ‡ฎ๐Ÿ‡ท U+1F1EE U+1F1F7 Iran
IS ๐Ÿ‡ฎ๐Ÿ‡ธ U+1F1EE U+1F1F8 Iceland
IT ๐Ÿ‡ฎ๐Ÿ‡น U+1F1EE U+1F1F9 Italy
JE ๐Ÿ‡ฏ๐Ÿ‡ช U+1F1EF U+1F1EA Jersey
JM ๐Ÿ‡ฏ๐Ÿ‡ฒ U+1F1EF U+1F1F2 Jamaica
JO ๐Ÿ‡ฏ๐Ÿ‡ด U+1F1EF U+1F1F4 Jordan
JP ๐Ÿ‡ฏ๐Ÿ‡ต U+1F1EF U+1F1F5 Japan
KE ๐Ÿ‡ฐ๐Ÿ‡ช U+1F1F0 U+1F1EA Kenya
KG ๐Ÿ‡ฐ๐Ÿ‡ฌ U+1F1F0 U+1F1EC Kyrgyzstan
KH ๐Ÿ‡ฐ๐Ÿ‡ญ U+1F1F0 U+1F1ED Cambodia
KI ๐Ÿ‡ฐ๐Ÿ‡ฎ U+1F1F0 U+1F1EE Kiribati
KM ๐Ÿ‡ฐ๐Ÿ‡ฒ U+1F1F0 U+1F1F2 Comoros
KN ๐Ÿ‡ฐ๐Ÿ‡ณ U+1F1F0 U+1F1F3 Saint Kitts and Nevis
KP ๐Ÿ‡ฐ๐Ÿ‡ต U+1F1F0 U+1F1F5 North Korea
KR ๐Ÿ‡ฐ๐Ÿ‡ท U+1F1F0 U+1F1F7 South Korea
KW ๐Ÿ‡ฐ๐Ÿ‡ผ U+1F1F0 U+1F1FC Kuwait
KY ๐Ÿ‡ฐ๐Ÿ‡พ U+1F1F0 U+1F1FE Cayman Islands
KZ ๐Ÿ‡ฐ๐Ÿ‡ฟ U+1F1F0 U+1F1FF Kazakhstan
LA ๐Ÿ‡ฑ๐Ÿ‡ฆ U+1F1F1 U+1F1E6 Lao People's Democratic Republic
LB ๐Ÿ‡ฑ๐Ÿ‡ง U+1F1F1 U+1F1E7 Lebanon
LC ๐Ÿ‡ฑ๐Ÿ‡จ U+1F1F1 U+1F1E8 Saint Lucia
LI ๐Ÿ‡ฑ๐Ÿ‡ฎ U+1F1F1 U+1F1EE Liechtenstein
LK ๐Ÿ‡ฑ๐Ÿ‡ฐ U+1F1F1 U+1F1F0 Sri Lanka
LR ๐Ÿ‡ฑ๐Ÿ‡ท U+1F1F1 U+1F1F7 Liberia
LS ๐Ÿ‡ฑ๐Ÿ‡ธ U+1F1F1 U+1F1F8 Lesotho
LT ๐Ÿ‡ฑ๐Ÿ‡น U+1F1F1 U+1F1F9 Lithuania
LU ๐Ÿ‡ฑ๐Ÿ‡บ U+1F1F1 U+1F1FA Luxembourg
LV ๐Ÿ‡ฑ๐Ÿ‡ป U+1F1F1 U+1F1FB Latvia
LY ๐Ÿ‡ฑ๐Ÿ‡พ U+1F1F1 U+1F1FE Libya
MA ๐Ÿ‡ฒ๐Ÿ‡ฆ U+1F1F2 U+1F1E6 Morocco
MC ๐Ÿ‡ฒ๐Ÿ‡จ U+1F1F2 U+1F1E8 Monaco
MD ๐Ÿ‡ฒ๐Ÿ‡ฉ U+1F1F2 U+1F1E9 Moldova
ME ๐Ÿ‡ฒ๐Ÿ‡ช U+1F1F2 U+1F1EA Montenegro
MF ๐Ÿ‡ฒ๐Ÿ‡ซ U+1F1F2 U+1F1EB Saint Martin (French Part)
MG ๐Ÿ‡ฒ๐Ÿ‡ฌ U+1F1F2 U+1F1EC Madagascar
MH ๐Ÿ‡ฒ๐Ÿ‡ญ U+1F1F2 U+1F1ED Marshall Islands
MK ๐Ÿ‡ฒ๐Ÿ‡ฐ U+1F1F2 U+1F1F0 Macedonia
ML ๐Ÿ‡ฒ๐Ÿ‡ฑ U+1F1F2 U+1F1F1 Mali
MM ๐Ÿ‡ฒ๐Ÿ‡ฒ U+1F1F2 U+1F1F2 Myanmar
MN ๐Ÿ‡ฒ๐Ÿ‡ณ U+1F1F2 U+1F1F3 Mongolia
MO ๐Ÿ‡ฒ๐Ÿ‡ด U+1F1F2 U+1F1F4 Macao
MP ๐Ÿ‡ฒ๐Ÿ‡ต U+1F1F2 U+1F1F5 Northern Mariana Islands
MQ ๐Ÿ‡ฒ๐Ÿ‡ถ U+1F1F2 U+1F1F6 Martinique
MR ๐Ÿ‡ฒ๐Ÿ‡ท U+1F1F2 U+1F1F7 Mauritania
MS ๐Ÿ‡ฒ๐Ÿ‡ธ U+1F1F2 U+1F1F8 Montserrat
MT ๐Ÿ‡ฒ๐Ÿ‡น U+1F1F2 U+1F1F9 Malta
MU ๐Ÿ‡ฒ๐Ÿ‡บ U+1F1F2 U+1F1FA Mauritius
MV ๐Ÿ‡ฒ๐Ÿ‡ป U+1F1F2 U+1F1FB Maldives
MW ๐Ÿ‡ฒ๐Ÿ‡ผ U+1F1F2 U+1F1FC Malawi
MX ๐Ÿ‡ฒ๐Ÿ‡ฝ U+1F1F2 U+1F1FD Mexico
MY ๐Ÿ‡ฒ๐Ÿ‡พ U+1F1F2 U+1F1FE Malaysia
MZ ๐Ÿ‡ฒ๐Ÿ‡ฟ U+1F1F2 U+1F1FF Mozambique
NA ๐Ÿ‡ณ๐Ÿ‡ฆ U+1F1F3 U+1F1E6 Namibia
NC ๐Ÿ‡ณ๐Ÿ‡จ U+1F1F3 U+1F1E8 New Caledonia
NE ๐Ÿ‡ณ๐Ÿ‡ช U+1F1F3 U+1F1EA Niger
NF ๐Ÿ‡ณ๐Ÿ‡ซ U+1F1F3 U+1F1EB Norfolk Island
NG ๐Ÿ‡ณ๐Ÿ‡ฌ U+1F1F3 U+1F1EC Nigeria
NI ๐Ÿ‡ณ๐Ÿ‡ฎ U+1F1F3 U+1F1EE Nicaragua
NL ๐Ÿ‡ณ๐Ÿ‡ฑ U+1F1F3 U+1F1F1 Netherlands
NO ๐Ÿ‡ณ๐Ÿ‡ด U+1F1F3 U+1F1F4 Norway
NP ๐Ÿ‡ณ๐Ÿ‡ต U+1F1F3 U+1F1F5 Nepal
NR ๐Ÿ‡ณ๐Ÿ‡ท U+1F1F3 U+1F1F7 Nauru
NU ๐Ÿ‡ณ๐Ÿ‡บ U+1F1F3 U+1F1FA Niue
NZ ๐Ÿ‡ณ๐Ÿ‡ฟ U+1F1F3 U+1F1FF New Zealand
OM ๐Ÿ‡ด๐Ÿ‡ฒ U+1F1F4 U+1F1F2 Oman
PA ๐Ÿ‡ต๐Ÿ‡ฆ U+1F1F5 U+1F1E6 Panama
PE ๐Ÿ‡ต๐Ÿ‡ช U+1F1F5 U+1F1EA Peru
PF ๐Ÿ‡ต๐Ÿ‡ซ U+1F1F5 U+1F1EB French Polynesia
PG ๐Ÿ‡ต๐Ÿ‡ฌ U+1F1F5 U+1F1EC Papua New Guinea
PH ๐Ÿ‡ต๐Ÿ‡ญ U+1F1F5 U+1F1ED Philippines
PK ๐Ÿ‡ต๐Ÿ‡ฐ U+1F1F5 U+1F1F0 Pakistan
PL ๐Ÿ‡ต๐Ÿ‡ฑ U+1F1F5 U+1F1F1 Poland
PM ๐Ÿ‡ต๐Ÿ‡ฒ U+1F1F5 U+1F1F2 Saint Pierre and Miquelon
PN ๐Ÿ‡ต๐Ÿ‡ณ U+1F1F5 U+1F1F3 Pitcairn
PR ๐Ÿ‡ต๐Ÿ‡ท U+1F1F5 U+1F1F7 Puerto Rico
PS ๐Ÿ‡ต๐Ÿ‡ธ U+1F1F5 U+1F1F8 Palestinian Territory
PT ๐Ÿ‡ต๐Ÿ‡น U+1F1F5 U+1F1F9 Portugal
PW ๐Ÿ‡ต๐Ÿ‡ผ U+1F1F5 U+1F1FC Palau
PY ๐Ÿ‡ต๐Ÿ‡พ U+1F1F5 U+1F1FE Paraguay
QA ๐Ÿ‡ถ๐Ÿ‡ฆ U+1F1F6 U+1F1E6 Qatar
RE ๐Ÿ‡ท๐Ÿ‡ช U+1F1F7 U+1F1EA Rรฉunion
RO ๐Ÿ‡ท๐Ÿ‡ด U+1F1F7 U+1F1F4 Romania
RS ๐Ÿ‡ท๐Ÿ‡ธ U+1F1F7 U+1F1F8 Serbia
RU ๐Ÿ‡ท๐Ÿ‡บ U+1F1F7 U+1F1FA Russia
RW ๐Ÿ‡ท๐Ÿ‡ผ U+1F1F7 U+1F1FC Rwanda
SA ๐Ÿ‡ธ๐Ÿ‡ฆ U+1F1F8 U+1F1E6 Saudi Arabia
SB ๐Ÿ‡ธ๐Ÿ‡ง U+1F1F8 U+1F1E7 Solomon Islands
SC ๐Ÿ‡ธ๐Ÿ‡จ U+1F1F8 U+1F1E8 Seychelles
SD ๐Ÿ‡ธ๐Ÿ‡ฉ U+1F1F8 U+1F1E9 Sudan
SE ๐Ÿ‡ธ๐Ÿ‡ช U+1F1F8 U+1F1EA Sweden
SG ๐Ÿ‡ธ๐Ÿ‡ฌ U+1F1F8 U+1F1EC Singapore
SH ๐Ÿ‡ธ๐Ÿ‡ญ U+1F1F8 U+1F1ED Saint Helena, Ascension and Tristan Da Cunha
SI ๐Ÿ‡ธ๐Ÿ‡ฎ U+1F1F8 U+1F1EE Slovenia
SJ ๐Ÿ‡ธ๐Ÿ‡ฏ U+1F1F8 U+1F1EF Svalbard and Jan Mayen
SK ๐Ÿ‡ธ๐Ÿ‡ฐ U+1F1F8 U+1F1F0 Slovakia
SL ๐Ÿ‡ธ๐Ÿ‡ฑ U+1F1F8 U+1F1F1 Sierra Leone
SM ๐Ÿ‡ธ๐Ÿ‡ฒ U+1F1F8 U+1F1F2 San Marino
SN ๐Ÿ‡ธ๐Ÿ‡ณ U+1F1F8 U+1F1F3 Senegal
SO ๐Ÿ‡ธ๐Ÿ‡ด U+1F1F8 U+1F1F4 Somalia
SR ๐Ÿ‡ธ๐Ÿ‡ท U+1F1F8 U+1F1F7 Suriname
SS ๐Ÿ‡ธ๐Ÿ‡ธ U+1F1F8 U+1F1F8 South Sudan
ST ๐Ÿ‡ธ๐Ÿ‡น U+1F1F8 U+1F1F9 Sao Tome and Principe
SV ๐Ÿ‡ธ๐Ÿ‡ป U+1F1F8 U+1F1FB El Salvador
SX ๐Ÿ‡ธ๐Ÿ‡ฝ U+1F1F8 U+1F1FD Sint Maarten (Dutch Part)
SY ๐Ÿ‡ธ๐Ÿ‡พ U+1F1F8 U+1F1FE Syrian Arab Republic
SZ ๐Ÿ‡ธ๐Ÿ‡ฟ U+1F1F8 U+1F1FF Swaziland
TC ๐Ÿ‡น๐Ÿ‡จ U+1F1F9 U+1F1E8 Turks and Caicos Islands
TD ๐Ÿ‡น๐Ÿ‡ฉ U+1F1F9 U+1F1E9 Chad
TF ๐Ÿ‡น๐Ÿ‡ซ U+1F1F9 U+1F1EB French Southern Territories
TG ๐Ÿ‡น๐Ÿ‡ฌ U+1F1F9 U+1F1EC Togo
TH ๐Ÿ‡น๐Ÿ‡ญ U+1F1F9 U+1F1ED Thailand
TJ ๐Ÿ‡น๐Ÿ‡ฏ U+1F1F9 U+1F1EF Tajikistan
TK ๐Ÿ‡น๐Ÿ‡ฐ U+1F1F9 U+1F1F0 Tokelau
TL ๐Ÿ‡น๐Ÿ‡ฑ U+1F1F9 U+1F1F1 Timor-Leste
TM ๐Ÿ‡น๐Ÿ‡ฒ U+1F1F9 U+1F1F2 Turkmenistan
TN ๐Ÿ‡น๐Ÿ‡ณ U+1F1F9 U+1F1F3 Tunisia
TO ๐Ÿ‡น๐Ÿ‡ด U+1F1F9 U+1F1F4 Tonga
TR ๐Ÿ‡น๐Ÿ‡ท U+1F1F9 U+1F1F7 Turkey
TT ๐Ÿ‡น๐Ÿ‡น U+1F1F9 U+1F1F9 Trinidad and Tobago
TV ๐Ÿ‡น๐Ÿ‡ป U+1F1F9 U+1F1FB Tuvalu
TW ๐Ÿ‡น๐Ÿ‡ผ U+1F1F9 U+1F1FC Taiwan
TZ ๐Ÿ‡น๐Ÿ‡ฟ U+1F1F9 U+1F1FF Tanzania
UA ๐Ÿ‡บ๐Ÿ‡ฆ U+1F1FA U+1F1E6 Ukraine
UG ๐Ÿ‡บ๐Ÿ‡ฌ U+1F1FA U+1F1EC Uganda
UM ๐Ÿ‡บ๐Ÿ‡ฒ U+1F1FA U+1F1F2 United States Minor Outlying Islands
US ๐Ÿ‡บ๐Ÿ‡ธ U+1F1FA U+1F1F8 United States
UY ๐Ÿ‡บ๐Ÿ‡พ U+1F1FA U+1F1FE Uruguay
UZ ๐Ÿ‡บ๐Ÿ‡ฟ U+1F1FA U+1F1FF Uzbekistan
VA ๐Ÿ‡ป๐Ÿ‡ฆ U+1F1FB U+1F1E6 Vatican City
VC ๐Ÿ‡ป๐Ÿ‡จ U+1F1FB U+1F1E8 Saint Vincent and The Grenadines
VE ๐Ÿ‡ป๐Ÿ‡ช U+1F1FB U+1F1EA Venezuela
VG ๐Ÿ‡ป๐Ÿ‡ฌ U+1F1FB U+1F1EC Virgin Islands, British
VI ๐Ÿ‡ป๐Ÿ‡ฎ U+1F1FB U+1F1EE Virgin Islands, U.S.
VN ๐Ÿ‡ป๐Ÿ‡ณ U+1F1FB U+1F1F3 Viet Nam
VU ๐Ÿ‡ป๐Ÿ‡บ U+1F1FB U+1F1FA Vanuatu
WF ๐Ÿ‡ผ๐Ÿ‡ซ U+1F1FC U+1F1EB Wallis and Futuna
WS ๐Ÿ‡ผ๐Ÿ‡ธ U+1F1FC U+1F1F8 Samoa
YE ๐Ÿ‡พ๐Ÿ‡ช U+1F1FE U+1F1EA Yemen
YT ๐Ÿ‡พ๐Ÿ‡น U+1F1FE U+1F1F9 Mayotte
ZA ๐Ÿ‡ฟ๐Ÿ‡ฆ U+1F1FF U+1F1E6 South Africa
ZM ๐Ÿ‡ฟ๐Ÿ‡ฒ U+1F1FF U+1F1F2 Zambia
ZW ๐Ÿ‡ฟ๐Ÿ‡ผ U+1F1FF U+1F1FC Zimbabwe

Functions

Function Return Description
GetCountries() IEnumerable<string> Gets the list of all countries in the world
GetCountryByCode Country Returns a single Country Data by ShortCode
GetCountryData() IEnumerable<Country> Gets the list of all countries in the world with their data
GetCountryEmojiFlag string Returns the Emoji Flag of a country by ShortCode
GetRegionByCountryCode List<Regions> Returns the Regions of a country by ShortCode
GetJsonData string Returns the JSON Data of all countries in the world

Flags

Function Return Description
GetFlagByCountryCode string Returns the Flag of a country by ShortCode
GetFlagData FlagModel Return the FlagModel of one country by ShortCode
GetNameByCountryCode string Returns the Name of a country by ShortCode

Get a full SVG

The GetFlagByCountryCode returns only the content of the SVG file. What it doesn't have is the XML declaration and the DOCTYPE declaration. If you want to get the full SVG file, you can use the GetFullSVG function in the SVGFlags static class.

var svgFlag = SVGFlags.GetFullSVG(SVGFlags.lgbt_1, "300", "300");

PureSourceCode.com

PureSourceCode.com is my personal blog where I publish posts about technologies and in particular source code and projects in .NET.

In the last few months, I created a lot of components for Blazor WebAssembly and Blazor Server.

My name is Enrico Rossini and you can contact me via:

Blazor Components

Component name Forum NuGet Website Description
AnchorLink Forum NuGet badge An anchor link is a web link that allows users to leapfrog to a specific point on a website page. It saves them the need to scroll and skim read and makes navigation easier. This component is for Blazor WebAssembly and Blazor Server
Autocomplete for Blazor Forum NuGet badge Simple and flexible autocomplete type-ahead functionality for Blazor WebAssembly and Blazor Server
Browser Detect for Blazor Forum NuGet badge Demo Browser detect for Blazor WebAssembly and Blazor Server
ChartJs for Blazor Forum NuGet badge Demo Add beautiful graphs based on ChartJs in your Blazor application
Clippy for Blazor Forum NuGet badge Demo Do you miss Clippy? Here the implementation for Blazor
CodeSnipper for Blazor Forum NuGet badge Add code snippet in your Blazor pages for 196 programming languages with 243 styles
Copy To Clipboard Forum NuGet badge Add a button to copy text in the clipboard
DataTable for Blazor Forum NuGet badge Demo DataTable component for Blazor WebAssembly and Blazor Server
Google Tag Manager Forum NuGet badge Demo Adds Google Tag Manager to the application and manages communication with GTM JavaScript (data layer).
Icons and flags for Blazor Forum NuGet badge Library with a lot of SVG icons and SVG flags to use in your Razor pages
ImageSelect for Blazor Forum NuGet badge This is a Blazor component to display a dropdown list with images based on ms-Dropdown by Marghoob Suleman. This component is built with NET7 for Blazor WebAssembly and Blazor Server
Markdown editor for Blazor Forum NuGet badge Demo This is a Markdown Editor for use in Blazor. It contains a live preview as well as an embeded help guide for users.
Modal dialog for Blazor Forum NuGet badge Simple Modal Dialog for Blazor WebAssembly
Modal windows for Blazor Forum NuGet badge Modal Windows for Blazor WebAssembly
Quill for Blazor Forum NuGet badge Quill Component is a custom reusable control that allows us to easily consume Quill and place multiple instances of it on a single page in our Blazor application
ScrollTabs NuGet badge Tabs with nice scroll (no scrollbar) and responsive
Segment for Blazor Forum NuGet badge This is a Segment component for Blazor Web Assembly and Blazor Server
Tabs for Blazor Forum NuGet badge This is a Tabs component for Blazor Web Assembly and Blazor Server
Timeline for Blazor Forum NuGet badge This is a new responsive timeline for Blazor Web Assembly and Blazor Server
Toast for Blazor Forum NuGet badge Toast notification for Blazor applications
Tours for Blazor Forum NuGet badge Guide your users in your Blazor applications
TreeView for Blazor Forum NuGet badge This component is a native Blazor TreeView component for Blazor WebAssembly and Blazor Server. The component is built with .NET7.
WorldMap for Blazor Forum NuGet badge Demo Show world maps with your data

C# libraries for .NET6

Component name Forum NuGet Description
PSC.Evaluator Forum NuGet badge PSC.Evaluator is a mathematical expressions evaluator library written in C#. Allows to evaluate mathematical, boolean, string and datetime expressions.
PSC.Extensions Forum NuGet badge A lot of functions for .NET5 in a NuGet package that you can download for free. We collected in this package functions for everyday work to help you with claim, strings, enums, date and time, expressions...

C# libraries for .NET8

Component name Forum NuGet Description
PSC.CSharp.Library.CountryData NuGet badge A simple cross platform offline .NET library for getting country data.
PSC.CSharp.Library.LanguageData NuGet badge This library is a comprehensive language code information, consisting of ISO 639-1, ISO 639-2 and IETF language types for C#.

More examples and documentation

Blazor

Blazor & NET8

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.9 148 8/23/2024
8.0.8 116 7/16/2024
8.0.7 103 7/16/2024
8.0.6 104 7/16/2024
8.0.5 104 7/15/2024
8.0.4 89 7/15/2024
8.0.3 120 6/19/2024