Why we use "this" in Extension Methods ?

Posted by M.H on Stack Overflow See other posts from Stack Overflow or by M.H
Published on 2010-04-04T12:08:14Z Indexed on 2010/04/04 12:13 UTC
Read the original article Hit count: 322

Filed under:

Hi, I want to ask why we use "this" keyword before the parameter in an extension method (C# Language)........... like this function :

    public static int ToInt(this string number)
    {
        return Int32.Parse(number);
    }

I know that we have to use it but I don't know why.

© Stack Overflow or respective owner

Related posts about c#