4.C#常用的数据类型

1. 字符串 

 string s = "123";
            string str = s;
            Console.WriteLine(s.Equals(str));
            Console.WriteLine(s.Equals("123"));
            Console.WriteLine(string.Equals(s, str));
            Console.ReadKey();

s.Equals(str) 表示 s == str 是否相等

2.数组

一维数组int[]a =new int[3]{1,2,3};或者是 int[]a = {1,2,3};

二维数组 in[ , ]b;多行多列的二维数组 b = new int[2,3] 或者是 b = new int[2,3]{ {1,2,3},{4,5,6}}; 

初始化并定义int b =  new int[2,3]{ {1,2,3},{4,5,6}}

 

枚举

用于生命一组命名常数

你可能感兴趣的:(UNITY)