Table of Contents

ThrowIfNumber Method

Definition

Namespace
Cuemon
Assemblies
Cuemon.Kernel.dll
Source
src/Cuemon.Kernel/Validator.cs

ThrowIfNumber(string, NumberStyles, IFormatProvider, string, string)

Validates and throws an ArgumentException if the specified argument is a number.

public static void ThrowIfNumber(string argument, NumberStyles styles = NumberStyles.Number, IFormatProvider provider = null, string message = "Value cannot be a number.", string paramName = null)

Parameters

argument string

The value to be evaluated.

styles NumberStyles

A bitwise combination of NumberStyles values that indicates the permitted format of argument.

provider IFormatProvider

An IFormatProvider that supplies culture-specific formatting information about argument.

message string

A message that describes the error.

paramName string

The name of the parameter that caused the exception.

Exceptions

ArgumentException

argument cannot be a number.