how to write extensions for console class .NET code example
Example: define extension methods c#
public static class MyExtensions
{
//use the this keyword before an argument
public static int WordCount(this String str)
{
return str.Split(new char[] { ' ', '.', '?' },
StringSplitOptions.RemoveEmptyEntries).Length;
}
}