凝霜若雪

博客园 首页 新随笔 联系 订阅 管理
  11 Posts :: 0 Stories :: 10 Comments :: 0 Trackbacks

公告

11 2007 档案

摘要: C#中没有统计子字符串出现次数的函数,那么如何在C#求出字符串中某字符的出现次数,比如求“ADSFGEHERGASDF”中“A”出现的次数。首先想到的方法当然是从头遍历字符串并统计:c1 = 0;for (int i = 0; i < str.Length; i++){ if (str[i] == 'A') { c1++; }}第二种方法也很容...阅读全文
posted @ 2007-11-15 17:33 侯唯 阅读(4133) | 评论 (5) 编辑

摘要: 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...阅读全文
posted @ 2007-11-15 10:39 侯唯 阅读(74) | 评论 (0) 编辑

摘要: using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;阅读全文
posted @ 2007-11-06 18:35 侯唯 阅读(1110) | 评论 (0) 编辑

摘要: 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]+$...阅读全文
posted @ 2007-11-06 18:33 侯唯 阅读(152) | 评论 (0) 编辑