摘要:
从一个简单的实例入手一、编写需要测试的类,该类为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 阅读全文