Added IsoCountryCodeToFlagEmoji
This commit is contained in:
parent
01520e50fc
commit
7902913880
1 changed files with 13 additions and 0 deletions
|
|
@ -439,6 +439,19 @@ public static class UniversalExtensions
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string GetAllDigits(this string str) =>
|
public static string GetAllDigits(this string str) =>
|
||||||
new(str.Where(Char.IsDigit).ToArray());
|
new(str.Where(Char.IsDigit).ToArray());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get country flag emoji based on Iso Country Code
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="country"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string IsoCountryCodeToFlagEmoji(this string country)
|
||||||
|
{
|
||||||
|
return string.Concat(country.ToUpper().Select(x => char.ConvertFromUtf32(x + 0x1F1A5)));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class StringExt
|
public static class StringExt
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue