I can't understand why C# doesn't have isxdigit as part of the standard library somewhere, so here's my little version of the venerable C isxdigit:
/// <summary>
/// Is a character 0-9 a-f A-F ?
/// </summary>
public static bool IsXDigit(char c)
{
  if ('0' <= c && c <= '9') return true;
  if ('a' <= c && c <= 'f') return true;
  if ('A' <= c && c <= 'F') return true;
  return false;
}

Thanks for reading! And if you want to get in touch, I'd love to hear from you: chris.hulbert at gmail.

Chris Hulbert

(Comp Sci, Hons - UTS)

Software Developer (Freelancer / Contractor) in Australia.

I have worked at places such as Google, Cochlear, Assembly Payments, News Corp, Fox Sports, NineMSN, FetchTV, Coles, Woolworths, Trust Bank, and Westpac, among others. If you're looking for help developing an iOS app, drop me a line!

Get in touch:
[email protected]
github.com/chrishulbert
linkedin



 Subscribe via RSS