原创 從字符串中提取子串得到數組的問題

 字符串:單據編號爲:[單據頭.單據編號],制單日期爲:[單據頭.業務日期],制單人是:[單據頭.制單人],請審覈.希望得到如下的數組:[[單據頭.單據編號],[單據頭.業務日期],[單據頭.制單人]]public static void

原创 C#寫自己的的集合

 (1)除了ArrayList, List,.NET還提供了Queue隊列,Stack堆棧,HashSet散列表,Dictionary字典,Tuple

原创 求得實際的接受到底數據大小

 int[] array = new int[1024];...byte[] array1 = array.Reverse().ToArray();int i = 0;while (i < 1024 && array[i] != 0) i

原创 泛型的Foreach方法與foreach語句的區別

 泛型的Foreach方法與foreach語句的區別?  List<Person> lst=new List<Person>();  lst.ForE

原创 一個字符串是否包含另一個字符串的問題

 string s1 = "2,3,4,5,11,";string s2 = "1,";2個字符串s1和s2,我用什麼方法判斷s2在不在s1裏呢,而不

原创 C#編碼好習慣

 1. 避免將多個類放在一個文件裏面。  2. 一個文件應該只有一個命名空間,避免將多個命名空間放在同一個文件裏面。3. 一個文件最好不要超過500行

原创 正則表達式整理備忘

 (1)“@”符號符下兩ows表研究室的火熱,當晨在“@”雖然並非C#正則表達式的“成員”,但是它經常與C#正則表達式出雙入對。“@”表示,跟在它後面

原创 C#格式化輸出控制

 C#的String.Format舉例stringstr1 =string.Format("{0:N1}",56789);              

原创 不用多態可以重新父類的方法和變量

 public class Father{ public Father(){// // TODO: 在此處添加構造函數邏輯 // } public int a = 1; public int b() { return this.a; }}

原创 快速排序,冒泡排序,插入排序 完整示例

 快速排序using System; using System.Collections.Generic; using System.Collections;using System.Text;namespace ConsoleApplic

原创 一個具有N個元素的數組,找出數組中的第二大的數

 using System;using System.Collections.Generic;using System.Collections; us

原创 集合中最大的那個數

 如何獲得List<int>集合中,最大的那個數 List<int> nums = new List<int>{1,2,3,4,5,6,7,8,9,10}; var result = nums.Where(p=>Max(p));forea

原创 排序

 http://student.zjzk.cn/course_ware/data_structure/web/PAIXU/paixu8.7.1.1.htm http://www.cppblog.com/shongbee2/archive/

原创 C#反轉字符串效率最高的方法

1、C#反轉字符串效率最高的方法 private string Reverse(string str){   char[] arr =str.ToCharArray();   Array.Reverse(arr);   return ne

原创 c#經典代碼(短小精悍的)

 using System; public class HelloWorld{ public static void Main() { Console.WriteLine(\"Hello, World!\"); }}http://topi