摘要:
class A<T> where T:new() 这是类型参数约束,where表名了对类型变量T的约束关系。where T:A 表示类型变量是继承于A的,或者是A本省。where T: new()指明了创建T的实例应该使用的构造函数。 .NET支持的类型参数约束有以下五种: where T: str 阅读全文
摘要:
function trim(s) { return trimRight(trimLeft(s)); } //去掉左边的空白 function trimLeft(s) { if (s == null) { return ""; } var whitespace = new String(" \t\n\ 阅读全文