# .NET MAUI Text Mask

To validate the user input as text symbols, use the `TextMaskedEntry`. The resulting value is a string object.

The table below lists the mask characters that can be used with `TextMaskedEntry`. The characters can be set to the `Mask` property.

| **Mask Character**   | **Description**                                                                                                                                                                                                                                                                                                                                                                                  |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `0`                  | (Required) Digit. This element will accept any single digit between 0 and 9.                                                                                                                                                                                                                                                                                                                     |
| `9`                  | (Optional) Digit or space.                                                                                                                                                                                                                                                                                                                                                                       |
| `#`                  | (Optional) Digit or space. If this position is blank in the mask, it will be rendered as the character in the [`PromptChar`](https://www.telerik.com/maui-ui/documentation/controls/maskedentry/prompt-character) property. For example, `"$######.##"` displays as a literal `"$"`, accepts a numeric amount with six places and two places to the right of the decimal, that is, `$123456.56`. |
| `L`                  | (Required) Accepts letters only.                                                                                                                                                                                                                                                                                                                                                                 |
| `?`                  | (Optional) Letter.                                                                                                                                                                                                                                                                                                                                                                               |
| `&`                  | (Required) Character.                                                                                                                                                                                                                                                                                                                                                                            |
| `C`                  | (Optional) Character.                                                                                                                                                                                                                                                                                                                                                                            |
| `A`                  | (Required) Alphanumeric. Accepts any symbol.                                                                                                                                                                                                                                                                                                                                                     |
| `a`                  | (Optional) Alphanumeric.                                                                                                                                                                                                                                                                                                                                                                         |
| `.`                  | Decimal placeholder.                                                                                                                                                                                                                                                                                                                                                                             |
| `,`                  | Thousands placeholder.                                                                                                                                                                                                                                                                                                                                                                           |
| `:`                  | Time separator.                                                                                                                                                                                                                                                                                                                                                                                  |
| `/`                  | Date separator.                                                                                                                                                                                                                                                                                                                                                                                  |
| `$`                  | Currency symbol.                                                                                                                                                                                                                                                                                                                                                                                 |
| `<`                  | Shifts down. Converts all characters that follow to lowercase.                                                                                                                                                                                                                                                                                                                                   |
| `>`                  | Shifts up. Converts all characters that follow to uppercase.                                                                                                                                                                                                                                                                                                                                     |
| `\`                  | Disables a previous shift up or shift down.                                                                                                                                                                                                                                                                                                                                                      |
| `\\`                 | Escape. Escapes a mask character, turning it into a literal. `"\\"` is the escape sequence for a backslash.                                                                                                                                                                                                                                                                                      |
| All other characters | All non-mask elements will appear as themselves within `RadTextMaskedEntry`. Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.                                                                                                                                                                                                       |

## Additional Properties

The `RadTextMaskedEntry` provides the following additional properties:

* `AllowOnlyCompletedValues` (`bool`)—Defines whether only completed (valid) values are accepted. When set to `True`, invalid values are not accepted. When set to `False`, incomplete values are accepted and the `ValueChanging` and `ValueChanged` events are raised.
* `RestrictToAscii` (`bool`)—Defines whether the input is restricted to ASCII characters only.

## Example

The following example demonstrates how to create a `RadTextMaskedEntry`:

```XAML
<telerik:RadTextMaskedEntry x:Name="textMaskedEntry" Mask="aaaaaaaaaaaaaaaaaaaa" AutomationId="textMask" />
```

The image below shows the end result.

![.NET MAUI TextMaskedEntry](https://www.telerik.com/maui-ui/documentation/assets/9b0e0ba8badf3d107ebe50361b2ee9db/maskedentry_text.png)

> For the MaskedEntry Text Mask examples, go to the [SDKBrowser Demo Application](https://www.telerik.com/maui-ui/documentation/demos-and-sample-apps/sdkbrowser-app) and navigate to MaskedEntry -> Mask Types category.

## See Also

* [Getting Started](https://www.telerik.com/maui-ui/documentation/controls/maskedentry/getting-started)
* [Validation](https://www.telerik.com/maui-ui/documentation/controls/maskedentry/validation)
* [Null Values Support](https://www.telerik.com/maui-ui/documentation/controls/maskedentry/value#null-value-support})
* [Events](https://www.telerik.com/maui-ui/documentation/controls/maskedentry/events)
* [Globalization](https://www.telerik.com/maui-ui/documentation/controls/maskedentry/globalization)
