MaskedTextProvider.VerifyString Method

Definition

Tests whether the specified string could be set successfully.

Overloads

VerifyString(String)

Tests whether the specified string could be set successfully.

VerifyString(String, Int32, MaskedTextResultHint)

Tests whether the specified string could be set successfully, and then outputs position and descriptive information.

VerifyString(String)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Tests whether the specified string could be set successfully.

C#
public bool VerifyString(string input);

Parameters

input
String

The String value to test.

Returns

true if the specified string represents valid input; otherwise, false.

Remarks

The VerifyString applies the input string against the mask, without actually changing the formatted string, to test whether input would be valid in a corresponding Set operation. This method also returns true if input is null or has zero length.

See also

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

VerifyString(String, Int32, MaskedTextResultHint)

Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs
Source:
MaskedTextProvider.cs

Tests whether the specified string could be set successfully, and then outputs position and descriptive information.

C#
public bool VerifyString(string input, out int testPosition, out System.ComponentModel.MaskedTextResultHint resultHint);

Parameters

input
String

The String value to test.

testPosition
Int32

If successful, the zero-based position of the last character actually tested; otherwise, the first position where the test failed. An output parameter.

resultHint
MaskedTextResultHint

A MaskedTextResultHint that succinctly describes the result of the test operation. An output parameter.

Returns

true if the specified string represents valid input; otherwise, false.

Remarks

The VerifyString applies the input string against the mask, without actually changing the formatted string, to test whether input would be valid in a corresponding Set operation. This method also returns true if input is null or has zero length.

This version of VerifyString provides two additional output parameters to convey more information about the operation of the method.

See also

Applies to

.NET 10 a ďalšie verzie
Produkt Verzie
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1