字符串 字符串是Unicode字符串数组,且是不可变的 这种操作不会影响到原来的字符串,它会新添加一个副本. 有关Split的操作 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Reflection; using System.Runtime.CompilerServices; usin…
1.用枚举类型替代int枚举类型和string枚举类型 public class Show { // Int枚举类型 // public static final int APPLE_FUJI = 0; // public static final int APPLE_PIPPIN = 1; // public static final int APPLE_GRANNY_SMITH = 2; public enum Apple { FUJI, PIPPIN, GR…
先定义一个枚举类型 , 初中, 高中,大学 }; int ->enum int d=2; PropertyType a=(PropertyType)d; int <- enum PropertyType d = PropertyType.小学; int a = Convert.ToInt32(d); Enum类有关的方法 Enum.Parse 方法 (Type, String) 将一个或多个枚举常数的名称或数字值的字符串表示转换成等效的枚举对象. public static Object…