Skip to content

StringValidation.Result Struct

The object produced when validating a string.

C#
public readonly struct StringValidation.Result

Creates a new string validation result.

C#
public Result(bool isValid, string? errorMsg = null)

isValid bool
A value to indicate that the result is valid or not.

errorMsg string
A message associated with the result when isValid is false.

Indicates whether or not this result is valid.

C#
public readonly bool IsValid

The error message when IsValid is false. May be an empty string when there isn’t a message.

C#
public readonly string ErrorMessage

A successful result.

C#
public static StringValidation.Result Success()

StringValidation.Result
A successful result.