将以逗号为分隔符的字符串转换成字符串数组

Posted on 2018-05-28 10:54 MaxsBlog 阅读() 评论() 编辑 收藏

随笔记一下:

需要引用:

using System.Text.RegularExpressions;

1 public static string[] StrList(string ValStr)
2         {
3             int i = 0;
4             string str = ValStr;
5             string[] sArray = Regex.Split(str, ",", RegexOptions.IgnoreCase);
6             return sArray;
7         }

View Code

 

版权声明:本文为Maxs原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/Maxs/p/9098973.html