2017-09-07 23:10:17 +02:00
|
|
|
using System.Globalization;
|
2014-10-27 21:12:57 +01:00
|
|
|
|
2014-11-03 00:05:54 +01:00
|
|
|
namespace System.Unicode
|
2014-10-27 21:12:57 +01:00
|
|
|
{
|
2014-12-16 02:32:00 +01:00
|
|
|
/// <summary>Provides extensions to the <see cref="UnicodeCategory"/> type.</summary>
|
2014-10-27 21:12:57 +01:00
|
|
|
public static class UnicodeCategoryExtensions
|
|
|
|
|
{
|
2014-12-16 02:32:00 +01:00
|
|
|
/// <summary>Gets the short name of the unicode category.</summary>
|
|
|
|
|
/// <param name="category">The category whose short name should be retrieved.</param>
|
|
|
|
|
/// <returns>The short name of the unicode category.</returns>
|
2014-10-27 21:12:57 +01:00
|
|
|
public static string GetShortName(this UnicodeCategory category)
|
|
|
|
|
{
|
2014-11-03 00:05:54 +01:00
|
|
|
return UnicodeCategoryInfo.Get(category).ShortName;
|
2014-10-27 21:12:57 +01:00
|
|
|
}
|
|
|
|
|
|
2014-12-16 02:32:00 +01:00
|
|
|
/// <summary>Gets the long name of the unicode category.</summary>
|
|
|
|
|
/// <param name="category">The category whose long name should be retrieved.</param>
|
|
|
|
|
/// <returns>The long name of the unicode category.</returns>
|
2014-10-27 21:12:57 +01:00
|
|
|
public static string GetLongName(this UnicodeCategory category)
|
|
|
|
|
{
|
2014-11-03 00:05:54 +01:00
|
|
|
return UnicodeCategoryInfo.Get(category).LongName;
|
2014-10-27 21:12:57 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|