学习转换成数字相加的思想 

public static int ToDateInt(string dateStr)
        {
            if (string.IsNullOrEmpty(dateStr))
            {
                return 0;
            }
            string[] dateString = dateStr.Split(' ');
            string Date = dateString[0];
            char[] split = new char[2];
            split[0] = '/';
            split[1] = '-';
            string[] array = null;
            array = Date.Split(split);
            return System.Int32.Parse(array[0]) * 10000 + System.Int32.Parse(array[1]) * 100 + System.Int32.Parse(array[2]);
        }

 posted on 2017-09-08 17:07  改变一下  阅读(483)  评论(0编辑  收藏  举报