CSharp examples for System.Collections.Generic:List
Convert String To List Int
using System.Reflection; using System.Collections; using System.ComponentModel; using System.Data; using System.Text; using System.Linq; using System.Collections.Generic; using System;/* w w w .ja va 2s. com*/ public class Main{ public static List<int> ConvertStringToListInt(string strInput, char strSplitCondition) { List<int> ret = new List<int>(); if (strInput != null) { string[] strTmp = strInput.Split(strSplitCondition); int tmp; foreach (var item in strTmp) { try { tmp = Convert.ToInt32(item); ret.Add(tmp); } catch (Exception ex) { ex.ToString(); } } } return ret; } }