Table of Contents

Class Validator

Namespace
NuvTools.Validation
Assembly
NuvTools.Validation.dll

Validators's class.

public static class Validator
Inheritance
Validator
Inherited Members

Methods

HasNumbersOnly(string)

Checks if the provided string contains only numeric characters.

public static bool HasNumbersOnly(this string input)

Parameters

input string

The string to check.

Returns

bool

True if the input contains only numeric characters, otherwise false.

IsDecimalNumber(string, bool, IFormatProvider?)

Checks if the provided string represents a valid decimal number.

public static bool IsDecimalNumber(this string input, bool positiveOnly = false, IFormatProvider? provider = null)

Parameters

input string

The string to check.

positiveOnly bool

If only positive numbers is valid.

provider IFormatProvider

An object that supplies culture-specific parsing information about s.

Returns

bool

True if the input is a valid decimal number, otherwise false.

IsEmail(string)

Validate the e-mail address.

public static bool IsEmail(this string value)

Parameters

value string

E-mail address

Returns

bool

IsIntNumber(string, bool)

Checks if the provided string represents a long type number.

public static bool IsIntNumber(this string input, bool positiveOnly = false)

Parameters

input string

The string to check.

positiveOnly bool

If only positive numbers is valid.

Returns

bool

True if the input is a whole number, otherwise false.

IsLongNumber(string, bool)

Checks if the provided string represents a long type number.

public static bool IsLongNumber(this string input, bool positiveOnly = false)

Parameters

input string

The string to check.

positiveOnly bool

If only positive numbers is valid.

Returns

bool

True if the input is a whole number, otherwise false.

Validate<T>(T)

public static List<string>? Validate<T>(this T obj)

Parameters

obj T

Returns

List<string>

Type Parameters

T