Check out example codes for "define extension methods c#". It will help you in understanding the concepts better.

Code Example 1

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;
  }
}

Learn ReactJs, React Native from akashmittal.com