-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
57 lines (48 loc) · 1.41 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Text;
using System.Collections.Generic;
using System.Collections;
namespace Cs
{
class Program
{
static void Main(string[] args)
{
List<string> list = new List<string>();
list.Add("ab");
list.Sort();
StringBuilder sb = new StringBuilder("Hello",50);
sb.ToString();
sb.Append(new String(" world"));
sb.AppendFormat(" Hello");//
sb.Replace('H','h');//替換前面參數是要替換的字
Console.WriteLine(list.Capacity);
sb.Insert(0,"owo ");//插入
/*
foreach(string i in list){
Console.WriteLine(i);
}
*/
}
}
class part {
public string partname{get; set; }
public int partid{get; set;}
public override string ToString(){
return "partname:"+partname+"ID"+partid;
}
public override bool Equals(object obj){
if(obj==null){return false;}
part objAspart = obj as part;
if(objAspart==null){return false;}
else return Equals(objAspart);
}
public override int GetHashCode(){
return partid;
}
public bool Equals(part other){
if(other==null){return false;}
return(this.partid.Equals(other.partid));
}
}
}