摘要: 从一个简单的实例入手一、编写需要测试的类,该类为String对象扩展了IsIn方法,目的是判断当前字符串是否存在于指定的数组中,代码如下:View Code public static class HelperString { public static bool IsIn(this string str, string[] strs) { if (strs == null) { if (str == null) { return true; } return false; } foreach (string item in strs) { if (str == item) { return 阅读全文
posted @ 2011-05-19 17:45 CNF 阅读(5196) 评论(1) 推荐(0) 编辑