08 2021 档案

c#基础篇 params参数修饰符
摘要:params参数定义:将实参列表中跟可变参数数组类型一致的元素都当做数组的元素去处理 int[] Maps=new int[10]; //方法体 public static void forIntArray(int io,params int[] array) { for (int i = 0; i 阅读全文
posted @ 2021-08-25 15:32 召唤师857 阅读(680) 评论(0) 推荐(0)
c#基础篇 out参数修饰符
摘要:定义:out参数就侧重于在一个方法中可以返回多个不同类型的值 //方法体 public int Get(int i,out int x,out string name) { x=0; name=""; return i;//返回前给out参数赋值 } //调用方法 int x;//接收返回值x st 阅读全文
posted @ 2021-08-25 15:15 召唤师857 阅读(747) 评论(0) 推荐(0)
c#基础篇 ref 参数修饰符
摘要:ref 参数定义:能够将变量带入一个方法中进行改变,改变完成后,再将改变后的值带出方法并赋值给原变量 int num1=10; int num2=20; //方法主体(变量值互换) public void Get(ref int n1,ref int n2) { int temp = n1; n1= 阅读全文
posted @ 2021-08-25 14:51 召唤师857 阅读(293) 评论(0) 推荐(0)
c# Unicode与字符串互转
摘要:/// <summary> /// <summary> /// 字符串转Unicode /// </summary> /// <param name="source">源字符串</param> /// <returns>Unicode编码后的字符串</returns> public static s 阅读全文
posted @ 2021-08-13 13:39 召唤师857 阅读(400) 评论(0) 推荐(0)