Using Mask Characters as Literals in Xamarin Masked Entry (SfMaskedEdit)

17 May 20211 minute to read

To use mask character as a literal, precede the mask character with a backslash (\). For example, to display the dollar sign ($), then set the mask as follows:

<syncmaskededit:SfMaskedEdit x:Name="maskedEdit" MaskType="Text" Mask="\$ 0000"/>
SfMaskedEdit maskedEdit = new SfMaskedEdit();
maskedEdit.MaskType = MaskType.Text;
maskedEdit.Mask = @"\$ 0000";

This will produce a mask that displays a dollar sign ($) followed by the prompt characters for entering numbers.

MaskAsLiterals support in Xamarin.Forms masked edit