Just now i read about Extension methods.I created static method inside static class its working fine.
static class ExtensionMethods
{
public static string splitFirstName(this string strName)
{
return strName.Split(" ".ToCharArray())[0];
}
}
But If i create static method inside Nonstatic class its not working.
class NonStaticCls
{
public static string splitFirstName(this string strName)
{
return strName.Split(" ".ToCharArray())[0];
}
}
Please tell why its not working in nonstatic class.