摘要:
namespace ExtendMethods{ public static class ExtendMethod { //定义string类型的扩展方法IsRight() public static bool IsRight(this string str) { switch (str.ToUpper().Trim()) { case "RIGHT": return true; case "YES": return true; case "OK": return true; default: return false; } } //定义int类型的扩展方法IsRight() public s 阅读全文