Is it better to use ToCharArray () or ToString () when comparing string and char?
I need to check if a string matches a specific char.
At the moment I am doing it like this:
if (InputData.ToCharArray() == 0x18)
is a string, and whenever I get to that point in my code, it should always only be char length.
My question is, would it be preferable to compare in some other way? For example, for example:
if (InputData == ((char)0x1c).ToString())
source to share