![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
人间十年
我来人间一趟,住个十年又何妨。
展开
-
C# ④ 结构类型struct的使用
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace _10_25_struct{ class Program { struct IS //定义一个结构类型 { public string w; public .原创 2021-10-25 11:32:09 · 475 阅读 · 0 评论 -
C# ②字符串的长度 Length
string A = "ABCD";Console.WriteLine($"{A}的长度为{A.Length}个字符。");使用属性Length可以返回字符串的字符数。原创 2021-10-19 18:00:00 · 2205 阅读 · 0 评论 -
C# ③ 使用Trim方法清除空格
string A =" ABC ";string A2=A.TrimStart(); //清除变量前的空格Console.WriteLine($"A2 结果是 [{A2}]");string A3=A.TrimEnd(); //清除变量后的空格Console.WriteLine($"A3 结果是 [{A3}]");string A4=A.Trim(); //清除变量前后的空格Console.WriteLine($"A4 结果是 [{A4}]");输出结果:...原创 2021-10-19 18:00:00 · 954 阅读 · 0 评论 -
C# ① Hello World
Console.WriteLine("Hello , World !");console 是 控制台窗口的类型;WriteLine是 该类型的方法。string表示文本,同样可以使用以下方法来输出”Hello World !”string A ="World";Console.WriteLine($"Hello {A} !")(在字符串的左引号前添加$,则可以在大括号之间的字符串内包括变量)...原创 2021-10-19 11:57:47 · 262 阅读 · 0 评论