ThrowIfDifferent Method
Definition
ThrowIfDifferent(string, string, string, string)
Validates and throws an ArgumentOutOfRangeException if there is a difference between second and first.
public static void ThrowIfDifferent(string first, string second, string paramName, string message = null)
Parameters
firststringThe value that specifies valid characters.
secondstringThe value to compare with
first.paramNamestringThe name of the parameter that caused the exception.
messagestringA message that describes the error.
Exceptions
- ArgumentOutOfRangeException
There is a difference between
secondandfirst.