I am trying to covert some VB.NET code to C# and found this interesting thing. Adding two chars returns different results in VB.NET and C#.
VB.NET -
(char)(1) has an ascii value of 1 and (char)(2) ascii value of 2
so ascii value of 1 + 2 (i.e. (char)1 + (char)2 ) will be equal to 3.
if you do: "2" + "1" this will give you "21" (althou you should not use this to join strings, bad practice)
if you do: '2' + '1' this will give you int value of 99 that is ascii value of 2 (which is 50) + ascii value of 1(which is 49).