Well I'm moving into C#.net and I was wondering how do you get the code for built in functions? Like instr and Xor those are both vb exclusive so I want to get the code for them to convert to C#. Where do you find the code for them?
Printable View
Well I'm moving into C#.net and I was wondering how do you get the code for built in functions? Like instr and Xor those are both vb exclusive so I want to get the code for them to convert to C#. Where do you find the code for them?
The direct equivalent of XOr is ^ in C#.
The indirect equivalent of InStr is the .NET method IndexOf.
XOr, AndAlso, OrElse, CType, CInt, etc. are not functions but part of the VB language. Some have direct equivalents and some have indirect equivalents. Check out the VB to C# converters for help with this (including ours: Instant C#).
You could also use Reflector to see the exact IL generated by VB code, but that will not necessarily lead to the obvious C# equivalent.