C#
是那个太阳
大学生一枚,虚心学习
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
C#语言基础六之正则表达式
正则表达式的语法和概念: 正则表达式教程 C#中有封装好的方法直接使用 举例: 待匹配字符串:“1851 1234 1950 1911 1922 00123” 正则表达式:"(?<=19)\d{2}\b" 预期功能:匹配跟随在”19“后面的两位数字 代码: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; us原创 2021-04-16 16:58:22 · 190 阅读 · 0 评论 -
C#语言基础五之try-catch-finally处理异常
try:尝试执行try中的代码,如果出现异常会停止执行跳转到catch中 catch:处理异常 反馈异常的问题 可以自行定义反馈’ finally:无论是否出现异常都会执行finally的代码 举例: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Test { class Program .原创 2021-04-16 16:00:39 · 424 阅读 · 0 评论 -
C#语言基础四之函数
C#中的函数声明和实现一般是在类中主函数外 举例说明: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Test { class Program { //用public static 关键字修饰 //无返回值无参数 public static void Show() { Cons原创 2021-04-16 15:46:13 · 171 阅读 · 0 评论 -
C#语言基础三之数组
C#中定义数组的方法: 一维数组 int[] d = new int[] {1,2,3,4,5,6}; int[] d = {1,2,3,4,5,6}; string[] s = new string[] {"Mike", "Linda"}; string[] s = {"Mike", "Linda"}; 二维数组 int[,] a = new int[3,3]; //3行3列 string[,] b = new string[2,2]; //2行2列 交叉数组 //数组第一行有三列,第二原创 2021-04-16 14:51:23 · 153 阅读 · 0 评论 -
C#语言基础二之循环
C#中定义数组的方法: 一维数组 int[] d = new int[] {1,2,3,4,5,6}; int[] d = {1,2,3,4,5,6}; string[] s = new string[] {"Mike", "Linda"}; string[] s = {"Mike", "Linda"}; 二维数组 int[,] a = new int[3,3]; //3行3列 string[,] b = new string[2,2]; //2行2列 交叉数组 //数组第一行有三列,第二原创 2021-04-16 14:49:36 · 142 阅读 · 0 评论 -
C#语言基础一之Hello World
C# —— Csharp 背景:微软专为.NET(.dotnet)推出的高级编程语言 Unity借助Mono实现跨平台,核心是.NET Framework框架,底层还是C++ C#第一个程序 打印Hello World 过程: .cs文件 => 编译生成.exe文件 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;原创 2021-04-16 13:57:47 · 229 阅读 · 0 评论
分享