'HEX'에 해당하는 글 1건


        public static string ParseHex(string hex)
        {
            char[] result = new char[hex.Length / 2];

            int hexIndex = 0;
            for (int i = 0; i < result.Length; i++)
            {
                result[i] = (char)(ParseHexDigit(hex[hexIndex++]) * 16 +
                ParseHexDigit(hex[hexIndex++]));
            }
            return new string(result);
        }

        static int ParseHexDigit(char c)
        {
            if (c >= '0' && c <= '9')
            {
                return c - '0';
            }
            if (c >= 'a' && c <= 'f')
            {
                return c - 'a' + 10;
            }
            if (c >= 'A' && c <= 'F')
            {
                return c - 'A' + 10;
            }
            throw new ArgumentException("Invalid hex character");
        }

@ http://blog.naver.com/mykojae?Redirect=Log&logNo=50080349024

'020. Prigraming > 01. C#' 카테고리의 다른 글

[C#] Winform에 외부폰트 적용하기  (0) 2011.10.19
[C#] string to byte  (0) 2011.07.29
[C#] 프로세스가 살아있다.  (0) 2011.07.01
[C#] 2진수변환  (2) 2011.05.23
[C#] dictionary  (0) 2011.04.01

WRITTEN BY
테네시왈츠
항상 겸손하게 항상 새롭게 항상 진실하게

,