string 转成 List<int> - StringToListInt
2017-02-05 10:42:52 访问(1619) 赞(0) 踩(0)
/// <summary>
/// string 转成 List<int> +
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static List<int> stringToListInt(string str)
{
string[] sArray = str.Split((",").ToCharArray());
List<int> theList = new List<int>();
foreach (string s in sArray)
{
if (s == null || s.Trim().Length == 0)
continue;
theList.Add(int.Parse(s));
}
return theList;
}
标签:
string 转成 List<int> - StringToListInt 


上一条:
下一条:
相关评论
发表评论