s1ckOh
Well-known member
I found a function I want to use in my project but when I used an online conversion tool I get an error.
C# Code...
Conversion tool gave me this with the error, "Operator '-' is not defined for types 'Char' and 'Char'"
Here is what I got to work, it outputs "16"
Question. Is the 3rd example equivelent to the C# code I want to use? Would it also output "16"?
Just trying to make sure I completely understand this before using it.
Thank you for any info.
C# Code...
VB.NET:
return (byte)('G' - 'A' + 10);
Conversion tool gave me this with the error, "Operator '-' is not defined for types 'Char' and 'Char'"
VB.NET:
Return CByte("G"c - "A"c + 10)
Here is what I got to work, it outputs "16"
VB.NET:
Return CByte(Asc("G"c) - Asc("A"c) + 10)
Question. Is the 3rd example equivelent to the C# code I want to use? Would it also output "16"?
Just trying to make sure I completely understand this before using it.
Thank you for any info.