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

IsInteger

Checks whether the type is integer.

Source

public static bool IsInteger(this Type type)
{
	return type.Equals(typeof(int));
}

Example

Type type = (1).GetType();
bool isString = type.IsInteger();

Author: kevinjong

Submitted on: 24 mrt. 2010

Language: C#

Type: System.Type

Views: 6796