mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-24 04:02:36 +01:00
22 lines
761 B
C#
22 lines
761 B
C#
namespace Nikse.SubtitleEdit.Core
|
|
{
|
|
public static class CharUtils
|
|
{
|
|
/// <summary>
|
|
/// Checks if character matches [0-9]
|
|
/// </summary>
|
|
/// <param name="ch"></param>
|
|
public static bool IsDigit(char ch) => ch >= '0' && ch <= '9';
|
|
|
|
/// <summary>
|
|
/// Checks if given character is hexadecimal
|
|
/// </summary>
|
|
/// <param name="ch"></param>
|
|
public static bool IsHexadecimal(char ch) => ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'f' || ch >= 'A' && ch <= 'F';
|
|
|
|
/// <summary>
|
|
/// Checks if character is between A-Z or a-z
|
|
/// </summary>
|
|
public static bool IsEnglishAlphabet(char ch) => ch >= 'A' && ch <= 'z' && (ch <= 'Z' || ch >= 'a');
|
|
}
|
|
} |