List 转string[]

记录下这个功能,也是比较常用的,主要是ToArray方法。

 public static String[] GetAllRuleHref()
        {
            //IList<Rules> rule = RuleManager.GetAllRule();
            List<String> rid = new List<string>();
            for (int i = 0; i < rule.Count; i++)
            {
                Rules rul = rule[i];
                rid.Add(rul.RuHref);
            }
            return rid.ToArray();
        }



你可能感兴趣的:(List 转string[])