There are a bunch of constants like vbTab in VB.Net, is there corresponding one in C# ?
Code Converter (VB - C#)Adds context menu items to convert projects/files between VB.NET and C#. Flexible: Convert a small selection, or a whole solution in one go, in either direction. Accurate: Full project context (through Roslyn) is used to get the most accurate conversion.
There is nothing like "convert some variable to constant" as constants are compile time value. If you want the values in integer array to be non-changable once it is set, consider using a ReadOnlyCollection<int> instead.
Represents a linefeed character for print and display functions. public: System::String ^ vbLf; C# Copy.
This example uses the IsNull function to determine if a variable contains a Null. Dim MyVar, MyCheck MyCheck = IsNull(MyVar) ' Returns False. MyVar = "" MyCheck = IsNull(MyVar) ' Returns False. MyVar = Null MyCheck = IsNull(MyVar) ' Returns True.
There is not an exact corresponding set of constants oriented for C#. Certain constants are simply represented in string form (e.g., "\t"
for vbTab
).
I would suggest not referencing the Microsoft.VisualBasic
assembly to use those constants. That namespace mainly exists to support migration of legacy VB6 applications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With