Struct MaskChar
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
A character which represents a set of allowed values in a MudMask.
public struct MaskChar
- Inherited Members
- Extension Methods
Remarks
Masks are built from mask characters, which each represent a regular expression for that character.
For example: the mask character 0
with regular expression \d
would allow any digit for that character.
Constructors
MaskChar(char, string)
Creates a new mask character with its associated regular expression.
public MaskChar(char c, string regex)
Parameters
c
charThe character to use in the mask.
regex
stringThe regular expression for allowed values for this character.
Remarks
For example: Given a mask character of 0
and expression of \d
, a mask of 000-00-0000
would allow any digit for the 0
character.
Properties
Char
The character to use in the mask.
public char Char { readonly get; set; }
Property Value
Regex
The regular expression defining allowed characters.
public string Regex { readonly get; set; }
Property Value
Methods
Digit(char)
Gets a mask character which allows any digit.
public static MaskChar Digit(char c)
Parameters
c
charThe mask character to create.
Returns
- MaskChar
A character with a regular expression of
\d
for any digit.
Letter(char)
Gets a mask character which allows any letter (uppercase or lowercase).
public static MaskChar Letter(char c)
Parameters
c
charThe mask character to create.
Returns
- MaskChar
A character with a regular expression of
\p{L}
for any letter.
LetterOrDigit(char)
Gets a mask character which allows any letter (uppercase or lowercase) or any digit.
public static MaskChar LetterOrDigit(char c)
Parameters
c
charThe mask character to create.
Returns
- MaskChar
A character with a regular expression of
\p{L}|\d
for any letter or digit.