工作之後收集了一些小的程式碼片段,上傳上來供大家搜尋,也方便自己尋找. 1.Regex單個字元統計方法 Dim str As String = "fkdsajfl甘jdsa甘kfjdsflaf"Dim reg As New Text.RegularExpressions.Regex("甘")MsgBox(reg.Matches(str).Count) 2.隱藏TabControl標籤 Private Sub frmPersonSetting_Resize(ByVal
void GetAllFileByDir(string DirPath,ref ArrayList AL){ //列舉出所有檔案,添加到AL foreach(string file in Directory.GetFiles(DirPath)) AL.Add(file); //列舉出所有子檔案夾,並對之調用GetAllFileByDir自己; foreach(string dir in
在很多模板庫中,都用到了C++的部分執行個體化。所謂部分執行個體化,是這樣的template<class T> class A { // 主模板 int x;};template<class T> class A<T*> { // 半執行個體化模板 long x;};template<template<class U> class V> class C { V<int> y;
Display all entries for C++ Algorithms on one page, or view entries individually: accumulatesum up a range of elements求和:用初值與指定範圍內的元素相加。重載的版本不再做加法,而是傳進來的二元操作符被應用到元素上。 adjacent_differencecompute the differences between adjacent elements in a
Long time ago I promised to show LINQ in a demo, instead of just showing slides. Finally it's online So to show you how much easier it is to write code in C# 3.0 than it was in C# 2.0, I've created a small webcast (about 25 minutes).In the webcast
Pure C++:泛型程式設計:模板特殊化發布日期: 9/30/2005 | 更新日期: 9/30/2005Stanley B. Lippman在上一期專欄中我已經談到過,執行的操作不僅包括簡單儲存和檢索操作的參數化型別僅限於可安全綁定到它的可接受類型 [請參閱 Pure C++: CLR Generics Versus C++ Templates(英文)]。使用泛型,可以通過 where 子句顯式加上這些限制。在 C++/CLI 模板工具中,通過將函數模板或類模板(單個成員函數或整個類)