I passed .NET quiz, when I met a question like below one.
Char ch = Convert.ToChar(\'a\' | \'e\' | \'c\' | \'a\');
In console we can see that o
Go to unicode-table.
'a'
Decimal value is 97 in binary it's 01100001
.'e'
Decimal value is 101 in binary it's 01100101
.'c'
Decimal value is 99 in binary it's 01100011
.'a'
Decimal value is 97 in binary it's 01100001
.Or operator in bit wise is '|'
.
So your expression is equal to:
01100001
OR
01100101
OR
01100011
OR
01100001
and the result for this is
01100111
.
Or results 1 if there is at least one time 1 in the column.
01100001
converting to Decimal is 103.
We will go again to the unicode-table and we will see that 103 in deciaml is equal to 'g'
.
So you asked what that function does, it calculates the binary value then converts it to Decimal value and returns the unicode character of it.