1.多维数组

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace ControlProject
{
class Program
{
static void Main(string[] args)
{
//新建一个3*4的数组
string[,] person = new string[, ];
person[, ] = "姓名";
person[, ] = "性别";
person[, ] = "职业";
person[, ] = "年龄"; person[, ] = "神秘";
person[, ] = "帅哥";
person[, ] = "农民工";
person[, ] = "26岁"; person[, ] = "小白";
person[, ] = "男";
person[, ] = "大宅男";
person[, ] = "27岁"; StringBuilder sb = new StringBuilder();//用一个可变字符串对象来接收循环中的值 //取出数组二维数组的长度
int x = person.GetLength();
int y = person.GetLength(); for (int i = ; i < x; i++)
{
for (int j = ; j < y; j++)
{
sb.Append(person[i, j] + " | ");
}
sb.Append("\n----------------------------------------------\n");
} Console.WriteLine(sb.ToString());
}
}
}

2.锯齿数组

在锯齿数组中,每一行都可以有不同的大小。

锯齿数组的效率比多维数组要高很多。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace ControlProject
{
class Program
{
static void Main(string[] args)
{
int[][] myint = new int[][];
myint[] = new int[] { , , };
myint[] = new int[] { , };
myint[] = new int[] { , , }; foreach (int[] i in myint)
{
foreach (int x in i)
{
Console.Write(x + ",");
}
Console.WriteLine();
} }
}
}

3.Array类

数组类型是从抽象基类型Array派生的引用类型,

由于此类型实现了IEnumerable和IEnumerable<(Of<(T>)>), 因此可以对C#中的所有数组使用foreach迭代

4.ArrayList

最新文章

  1. Effective前端2:优化html标签
  2. U盘容量变小的处理方式
  3. JsonString,字典,模型之间相互转换
  4. 调试SQLSERVER (一)生成dump文件的方法
  5. Win7 64位安装MySQL
  6. COB(Chip On Board)的製程簡單介紹
  7. 一个用于每一天JavaScript示例-SVG中间javaScript画廊
  8. Scrum与高效能人士
  9. Http状态码大全(来自菜鸟教程)
  10. javaSE_05Java中方法(函数)与重载、递归-思维导图
  11. win7 mysql 数据库轻松实现数据库定时备份
  12. 扩展资源服务器解决oauth2 性能瓶颈
  13. TensorFlow实战Google深度学习框架8-9章学习笔记
  14. Daily Scrum- 12/31
  15. cf220B莫队
  16. linux 删除开头是减号的文件名
  17. 开发十年,只剩下这套Java开发体系了
  18. QT中添加 动态库(.so) 和 静态库 (.a) 的方法
  19. JAVA框架 Spring AOP--切入点表达式和通知类型
  20. code vs 1094 FBI树 2004年NOIP全国联赛普及组

热门文章

  1. Atitit.linq&#160;java的原理与实现&#160;解释器模式
  2. Flex Air应用程序更改任务栏图标
  3. linux下调试使用的 一些shell命令
  4. 中移苏研DCOS实践之路完整篇
  5. php tp验证表单与自动填充函数
  6. css3的线性渐变效果
  7. linux 分卷压缩命令
  8. centos7 笔记本盒盖不睡眠
  9. ChemDraw是这样预测诺氟沙星NMR谱
  10. gtest入门简介