更新时间:2022-09-11 12:19:55
第一个程序,采用MessageBox.Show显示小对话框:
1: /*
2: * Created by SharpDevelop.
3: * User: feisky
4: * Date: 2009-10-27
5: * Time: 10:46
6: *
7: * To change this template use Tools | Options | Coding | Edit Standard Headers.
8: */
9: using System;
10: using System.Collections.Generic;
11: using System.Drawing;
12: using System.Windows.Forms;
13:
14: namespace test
15: {
16: /// <summary>
17: /// Description of MainForm.
18: /// </summary>
19: public partial class MainForm : Form
20: {
21: public MainForm()
22: {
23: //
24: // The InitializeComponent() call is required for Windows Forms designer support.
25: //
26: InitializeComponent();
27:
28: //
29: // TODO: Add constructor code after the InitializeComponent() call.
30: //
31: }
32:
33: void BtnShowDlgClick(object sender, EventArgs e)
34: {
35: MessageBox.Show("The first Csharp app.");
36: }
37: }
38: }
使用 Compare、CompareOrdinal、CompareTo、Equals、EndsWith 和 StartsWith 方法进行比较。
使用 IndexOf、IndexOfAny、LastIndexOf 和 LastIndexOfAny 方法可获取字符串中子字符串或 Unicode 字符的索引。
使用 Substring 和 Split 方法可通过原始字符串的组成部分创建一个或多个新字符串;使用 Concat 和 Join 方法可通过一个或多个子字符串创建新字符串。
使用 Insert、Replace、Remove、PadLeft、PadRight、Trim、TrimEnd 和 TrimStart 可修改字符串的全部或部分。
使用 ToLower、ToLowerInvariant、ToUpper 和 ToUpperInvariant 方法可更改字符串中 Unicode 字符的大小写。
使用 Format,可将字符串中的一个或多个格式项占位符替换为一个或多个数字、日期和时间或枚举值的文本表示形式。
使用 Length 属性可获取字符串中 Char 对象的数量;使用 Chars 属性可访问字符串中实际的 Char 对象。
使用 IsNormalized 方法可测试某个字符串是否已规范化为特定的范式。使用 Normalize 方法可创建规范化为特定范式的字符串。