Shuxia Ning
2025-01-17 a0bce3b366451b3ca94e676eb98dd7b415375c14
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
namespace HStation
{
    /// <summary>
    /// 
    /// </summary>
    internal class RevitFlagsHelper
    {
        //
        // 摘要:
        //     分隔符
        public const string Separator = ",";
 
        //
        // 摘要:
        //     转化为字符串
        public static string ToString(List<string> list)
        {
            if (list == null || !list.Any())
            {
                return string.Empty;
            }
            list = list.Select(x => x.Trim()).ToList();
            return string.Join(",", list);
        }
 
        //
        // 摘要:
        //     转化为列表
        public static List<string> ToList(string str)
        {
            if (string.IsNullOrEmpty(str))
            {
                return new List<string>();
            }
            var list = str.Split(new string[1] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
            return list?.Select(x => x.Trim()).ToList();
        }
 
 
    }
}