1
yhj
2024-07-24 5e5d945e91568b973faa27d8ab0bcef99fc4a6c5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace CSFrameworkV5.Core.Common
{
    internal static class ConvertEx
    {
        public static string ToString(object obj)
        {
            if (obj == null) return string.Empty;
            return obj.ToStringEx().Trim();
        }
 
        public static int ToInt(object obj)
        {
            if (obj == null) return 0;
            int i;
            if (int.TryParse(obj.ToStringEx(), out i))
                return i;
            else
                return 0;
        }
    }
}