ExtensionMethod.NET Home of 880 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: 5147