Does anyone know if VB.NET has a .NET framework alternative to CType().
In ILDASM for the following VB.NET code
Label1.Text = CType(aNumber, String)
where aNumber was declared as float
is
IL_000e: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.StringType::FromSingle(float32)
In C#
Label1.Text = (string)aNumber;
IL_000e: call instance string [mscorlib]System.Single::ToString()
In VB.net this seems to be going out to VB runtimes?, whereas C# is using System.Single within the framework.
What code in VB.NET would produce the same IL as C#?
In ILDASM for the following VB.NET code
Label1.Text = CType(aNumber, String)
where aNumber was declared as float
is
IL_000e: call string [Microsoft.VisualBasic]Microsoft.VisualBasic.CompilerServices.StringType::FromSingle(float32)
In C#
Label1.Text = (string)aNumber;
IL_000e: call instance string [mscorlib]System.Single::ToString()
In VB.net this seems to be going out to VB runtimes?, whereas C# is using System.Single within the framework.
What code in VB.NET would produce the same IL as C#?