ExtensionMethod.NET Home of 820 C#, Visual Basic, F# and Javascript extension methods

IsBoolean

Checks whether the type is Boolean.

Source

public static bool IsBoolean(this Type type)
{
	return type.Equals(typeof(Boolean));
}

Example

Type type = (false).GetType();
bool isString = type.IsBoolean();

Author: kevinjong

Submitted on: 24 mrt 2010

Language: C#

Type: System.Type

Views: 5441