Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tests whether the specified string could be set successfully.
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. |
Tests whether the specified string could be set successfully.
public:
bool VerifyString(System::String ^ input);
public bool VerifyString(string input);
member this.VerifyString : string -> bool
Public Function VerifyString (input As String) As Boolean
true
if the specified string represents valid input; otherwise, false
.
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.
Product | Versions |
---|---|
.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 |
Tests whether the specified string could be set successfully, and then outputs position and descriptive information.
public:
bool VerifyString(System::String ^ input, [Runtime::InteropServices::Out] int % testPosition, [Runtime::InteropServices::Out] System::ComponentModel::MaskedTextResultHint % resultHint);
public bool VerifyString(string input, out int testPosition, out System.ComponentModel.MaskedTextResultHint resultHint);
member this.VerifyString : string * int * MaskedTextResultHint -> bool
Public Function VerifyString (input As String, ByRef testPosition As Integer, ByRef resultHint As MaskedTextResultHint) As Boolean
If successful, the zero-based position of the last character actually tested; otherwise, the first position where the test failed. An output parameter.
A MaskedTextResultHint that succinctly describes the result of the test operation. An output parameter.
true
if the specified string represents valid input; otherwise, false
.
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.
Product | Versions |
---|---|
.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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in