char
is an integral type, just like int
and long
are, so you can add them together and use %
on the value of a char
instance.
In the same way that you can add int
s and %
them.
This explains why the above works.
What it means is a different question and is not so apparent. It could be the char
was used because of its range, but is used as an integral type. It cold be that this is a function that converts lowercase characters to upper case (or vice versa), but without more context it is impossible to tell.
It is entirely possible that the decompiler you are using has misinterpreted (or couldn't fully interpret) the IL and is presenting you with something equivalent to the IL, but that is not the same as the original code.