Thursday, 9 May 2013

Extension Method in C#


  


protected void Button1_Click(object sender, EventArgs e)
{
            string a ="AP";
            a.DoChange("A", "P");
    
       //it will retun  APAPAjay
}
 
public static class TestExtension
{
  public static string DoChange(this string x, string a,string B)
  {
     return x + a + b + "Ajay";
  }
}

No comments:

Post a comment