摘要:
1 static void Main(string[] args) 2 { 3 //格式化字符串Format 4 String a = "我是傻逼"; 5 String b = "WSSB"; 6 char c = '是'; 7 char d = 'B'; 8 String.Format("a={0 阅读全文
摘要:
C#格式化字符串 数值型格式化结果表(格式化字符串) 字符 说明 示例 输出 C 货币 string.Format("{0:C3}", 2) $2.000 D 十进制 string.Format("{0:D3}", 2) 002 E 科学计数法 1.20E+001 1.20E+001 G 常规 st 阅读全文
摘要:
IndexOf使用方法 1 static void Main(string[] args) 2 { 3 string a, b; 4 char aa = 'D'; 5 char bb = '5'; 6 a ="SB"; 7 b = "SBDX"; 8 /* 9 这里的IndexOf是求子串的位置,而 阅读全文
摘要:
9.6非静态和静态方法 1 namespace C_9_4 2 { 3 class Program 4 { 5 6 //类型声明应放在main函数前面 7 static void Main(string[] args) 8 { 9 string a, b,c,d; 10 int an; 11 a = 阅读全文
摘要:
Barney //搬运:https://www.cnblogs.com/zhxhdean/archive/2011/04/21/2023250.html c#静态方法和非静态方法区别 C#的类中可以包含两种方法:C#静态方法与非静态方法。那么他们的定义有什么不同呢?他们在使用上会有什么不同呢?让我们 阅读全文
摘要:
1 using System; 2 3 namespace C_9_4 4 { 5 class Program 6 { 7 8 //类型声明应放在main函数前面 9 static void Main(string[] args) 10 { 11 //String.Compare比较顺序,AaBbC 阅读全文
摘要:
1 static void Main(string[] args) 2 { 3 unchecked 4 { 5 int i; 6 i = int.MaxValue + 10; 7 Console.WriteLine("溢出的i={0}",i); 8 //或者写成 9 //Console.WriteL 阅读全文