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

IsString

Checks whether the type is string.

Source

public static bool IsString(this Type type)
{
	return type.Equals(typeof(string));
}

Example

Type type = ("Taiwan").GetType();
bool isString = type.IsString();

Author: kevinjong

Submitted on: 24 mrt. 2010

Language: C#

Type: System.Type

Views: 11356