MaskedTextProvider.Replace Method (Char, Int32, Int32, MaskedTextResultHint)
Replaces a single character at or beyond the specified position with the specified character value, and then outputs the removal position and descriptive information.
Assembly: System (in System.dll)
public bool Replace( char input, int position, out int testPosition, out MaskedTextResultHint resultHint )
- Type: System.Int32
The zero-based position to search for the first editable character to replace.
- Type: System.Int32
If successful, the zero-based position in the formatted string where the last character was actually replaced; otherwise, the first position where the operation failed. An output parameter.
Return ValueType: System.Boolean
true if the character was successfully replaced; otherwise, false.
The method searches for the first editable position in the formatted string at or beyond the specified position, pos. If one is found, the value of the editable position is changed to the specified character, input. Any of the following conditions will result in an error condition that causes no replacement to be performed and a value of false to be returned:
The pos parameter is less than zero or greater than the Length of the formatted string.
An editable character was not found in the formatted string at or beyond the specified position, pos.
The replacement character, input, is not a valid input character because it is not printable or does not match its corresponding mask element.
In addition to the return value, this method has two output parameters to supply additional information about the replacement operation.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.