# MaskedTextBoxRulesBuilder

## Methods

### Add(System.Char,System.String)

Adds a custom mask rule.

#### Parameters

##### name - `System.Char`

The name of the rule.

##### regexp - `System.String`

The JavaScript RegExp object assigned to defined rule.

#### RETURNS

Returns the current [MaskedTextBoxRulesBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/maskedtextboxrulesbuilder) instance.

#### Example

```
 
             @(Html.Kendo().MaskedTextBox()
                 .Name("maskedTextBox")
                 .Rules(rules =>
                     rules.Add('~', "/[+-]/")
                  )
             )
             
```

### Add(System.Char,System.Func)

Adds a custom mask rule.

#### Parameters

##### name - `System.Char`

The name of the rule.

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag (Razor syntax).

#### RETURNS

Returns the current [MaskedTextBoxRulesBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/maskedtextboxrulesbuilder) instance.

#### Example

```
 
             @(Html.Kendo().MaskedTextBox()
                 .Name("maskedTextBox")
                 .Rules(rules =>
                 {
                   rules.Add('^', @<text>
                      function(char) {
                        return char === "^";
                      }
                      </text>);
                  })
             )
             
```
