What is the best way to check if a single character is a whitespace?
I know how to check this through a regex.
But I am not sure if this is the best way if I onl
this covers spaces, tabs and newlines:
if ((ch == ' ') || (ch == '\t') || (ch == '\n'))
this should be best for performance. put the whitespace character you expect to be most likely, first.
if performance is really important, probably best to consider the bigger picture than individual operations like this...