摘要: C#中没有统计子字符串出现次数的函数,那么如何在C#求出字符串中某字符的出现次数,比如求“ADSFGEHERGASDF”中“A”出现的次数。首先想到的方法当然是从头遍历字符串并统计:c1 = 0;for (int i = 0; i < str.Length; i++){ if (str[i] == 'A') { c1++; }}第二种方法也很容...阅读全文
11 2007 档案
摘要: 1//声明2publicenumDefaultType:int3{4布料=1,5商标=2,6钢弓=4,7棉碗=88}9//绑定到comboBox10comboBox3.DataSource=Enum.GetValues(typeof(Dal.Class1.DefaultType));11//取得comboBox选定值12privatevoidcomboBox3_Leave(objectsender...阅读全文
摘要: using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;阅读全文
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;阅读全文
摘要: private static Regex RegNumber = new Regex("^[0-9]+$"); //正整数 private static Regex RegNumberSign = new Regex("^[+-]?[0-9]+$"); //正整数或负整数 private static Regex RegDecimal = new Regex("^[0-9]+[.]?[0-9]+$...阅读全文