ExtensionMethod.NET Home of 818 C#, Visual Basic, F# and Javascript extension methods

Increment

Increments a integer number by one

Source

public static class IntExtensions
{
    public static int Increment(this int i)
    {
        return ++i;
    }
}

Example

5.Increment(); // result should be six

Author: MrMostInteresting

Submitted on: 6 mrt 2015

Language: C#

Type: Int

Views: 2875