按升序排序
sort in Ascending Order
输入->windows 7 于 2017 年 1 月 1 日发布
输出
1个
7
2017年
简
在
释放
曾是
windows
做了小例子来理解对象解析成int类型参数。
List<object> _obj = new List<object>() { "10", "20", "30", "d", "a", "t" };
int sum = 0;
for (int i = 0; i < _obj.Count; i++)
{
int temp;
//parsing object into int type, when we cant parse object will be 0
int.TryParse(_obj[i].ToString(), out temp);
//sum values
sum = sum + temp;
}
输入->windows 7 于 2017 年 1 月 1 日发布 输出 1个 7 2017年 简 在 释放 曾是 windows
做了小例子来理解对象解析成int类型参数。
List<object> _obj = new List<object>() { "10", "20", "30", "d", "a", "t" };
int sum = 0;
for (int i = 0; i < _obj.Count; i++)
{
int temp;
//parsing object into int type, when we cant parse object will be 0
int.TryParse(_obj[i].ToString(), out temp);
//sum values
sum = sum + temp;
}