C#学习笔记之二(stack, queue, string, HashTable,StringBui

来源:互联网 发布:linux 类似telnet命令 编辑:程序博客网 时间:2024/06/04 18:25
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
queue:
Enqueue()
Dequeue()
Peek() //only get first element, not delete it
stack:
Count()
Clear()
Peek()
Pop()
Push()
CopyTo(array, offset) //copy to array
Dictionary/HashTable:
Keys //colleation of Keys,
Values //colleation of value
Count()
Clear()
Contains() // is element in HashTable
ContainsKey() // is Key in HashTable
Item() //Indexer for HashTable
Add() // Add entry with Key/Value
GetEnumerator() // creat and return a Enumator object
strings:
string
Compare() Split()
Concat() StartsWith()
Equals() ToLower()/ToUpper()
Insert() Trim()
Format()
string.Compare(s1,s2); //case sensitive
string.Compare(s1,s2, true) //case not sensitive
string s3 = @"test / .net"
string s6 string.Copy(s5);
string s7 = s6
S7 == S6
S7.Equals(s6)
string.Equals(s7,s6)
s7.Length
s3.EndWith("Test")
int offset = s3.indexOf("TEST") //first occurence
string s10 = s3.Insert(offset, "DDD");
string s11 = s3.Insert(s3.IndexOf("ddd"), "EEE");
s12.Split(delimiters)
Regex r = new Regex(" |,");
foreach( string s in r.Split(s12)) {}
stringBuilder
stringBuilder sb = new stringBuild();
Append()
Tostring()
Regular Expresstions:
using System.Text.RegularExpressio

学习笔记之二(stack, queue, string, HashTable,stringBuilder, Regular Expresstion)';return true">
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
原创粉丝点击