• Saves Valuable Time
  • Trusted Accuracy for 12 Years
  • 15-Day Money-Back Guarantee

C# Equivalent to VB Optional Parameters

Prior to C# 4, C# did not allow optional parameters.  Prior to C# 4, overloaded methods were the only alternative to converting VB optional parameters.  Instant C# now always converts to C# optional parameters.

VB C#
Public Sub TestOptional(Optional ByVal x As Integer = 0)
    ...
End Sub
public void TestOptional(int x = 0)
{
    ...
}


Use Instant C# and Instant VB to convert between VB.NET and C#.     

Additional resource: VB.NET and C# Equivalents


Copyright © 1997 – 2017 Tangible Software Solutions Inc.