列表和區分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