diff --git a/UniversalExtensions.cs b/UniversalExtensions.cs index 2c14e5b..3942fda 100644 --- a/UniversalExtensions.cs +++ b/UniversalExtensions.cs @@ -439,6 +439,19 @@ public static class UniversalExtensions /// public static string GetAllDigits(this string str) => new(str.Where(Char.IsDigit).ToArray()); + + + + /// + /// Get country flag emoji based on Iso Country Code + /// + /// + /// + public static string IsoCountryCodeToFlagEmoji(this string country) + { + return string.Concat(country.ToUpper().Select(x => char.ConvertFromUtf32(x + 0x1F1A5))); + } + } public static class StringExt