Hi.
I agree with
Sergey Alexandrovich Kryukov about
no bitwise operation can be found in your example.
However, you can rewrite your loop as:
for (int i = 0; i < 4; i++)
{
char ch = Input[i];
ch = char.ToUpperInvariant(ch);
int nValue = "0123456789ABCDEF".IndexOf(ch);
if (nValue < 0)
nValue = 0;
Input[i] = nValue;
}
This applies to raw chars input like your example.
If instead you have a
String as input, then you can use solution by
Andreas Gieriet.
Regards,
Daniele.