/// <summary> /// Formats a number as a hex digit /// </summary> /// <param name="i"></param> /// <returns></returns> public static string GetHexString(ulong i) { string hex = ""; while (i > 0) { hex = String.Concat(CharUtility.GetHexDigit((int)(i % 0x10)), hex); i >>= 4; } return(hex); }
/// <summary> /// Checks if string is null, empty or entirely made up of whitespace /// </summary> /// <param name="value"></param> /// <returns></returns> /// <remarks> /// Essentially the same as String.IsNullOrWhiteSpace from .NET 4.0 /// with a simplfied view of whitespace. /// </remarks> public static bool IsNullOrWhiteSpace(string value) { if (value != null) { for (int i = 0, length = value.Length; i < length; i++) { if (!CharUtility.IsWhiteSpace(value[i])) { return(false); } } } return(true); }