列表和区分INT和字符串值列表和区分INT和字符串值的字符串值
List<string> input = new List<string> { "1", "2", "three", "4", "five", "eight", "9" };
List<int> output1 = new List<int>{}; // keep the list here integer values
List<string> output2 = new List<string> { }; // keep the list here non numericic values
请帮我...提前
着想'List output1 = input.Select(int.Parse).ToList()'? –
2015-04-05 09:01:15
@SonerGönül它需要过滤非数值,否则会抛出异常 – 2015-04-05 09:25:15