Table of Contents

Class NumberHelpers

Namespace
Acuit.Pinpoint.Common
Assembly
Acuit.Pinpoint.Common.dll

Helper methods for dealing with model and serial numbers.

public static class NumberHelpers
Inheritance
NumberHelpers
Inherited Members

Methods

IsValid(string, bool, out string)

Returns whether the specified string is a valid number (i.e., all characters in the string are valid characters for model or serial numbers).

public static bool IsValid(string number, bool validateNotEmpty, out string errorMessage)

Parameters

number string

The string to test.

validateNotEmpty bool

Whether to validate that the number is not empty.

errorMessage string

Will be set to the error message if the number is invalid, or null if valid.

Returns

bool

true if the string is valid, or false otherwise

Remarks

Valid number characters are those that are printable ASCII characters (i.e., ASCII codes 32 to 126, decimal).

Exceptions

ArgumentNullException

number is null.

IsValid(string, out string)

Returns whether the specified string is a valid number (i.e., all characters in the string are valid characters for model or serial numbers).

public static bool IsValid(string number, out string errorMessage)

Parameters

number string

The string to test.

errorMessage string

Will be set to the error message if the number is invalid, or null if valid.

Returns

bool

true if the string is valid, or false otherwise

Remarks

Empty strings are considered valid.

Valid number characters are those that are printable ASCII characters (i.e., ASCII codes 32 to 126, decimal).

Exceptions

ArgumentNullException

number is null.