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

Posted on 2018-05-28 10:54  MaxsBlog  阅读(301)  评论(1)    收藏  举报

随笔记一下:

需要引用:

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

 

博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3