ValidationHelper.ValidateString(String, Int32, Boolean, String) Method
Definition
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.
Validates a string.
public:
static void ValidateString(System::String ^ value, int maximumLength, bool nullOrEmptyOk, System::String ^ paramName);
public static void ValidateString (string value, int maximumLength, bool nullOrEmptyOk, string paramName);
static member ValidateString : string * int * bool * string -> unit
Public Shared Sub ValidateString (value As String, maximumLength As Integer, nullOrEmptyOk As Boolean, paramName As String)
Parameters
- value
- String
The value to validate.
- maximumLength
- Int32
The maximum length of the string. Use 0 if there is no maximum.
- nullOrEmptyOk
- Boolean
Indicates if a null or empty string is OK to use.
- paramName
- String
The name of the parameter to throw the exception for.