摘要:
let s =[]; $.each($('#formSearch input'),(m,n)=>{s.push(n)}); //示例获取表单所有 input 下滑线分割的 name 集合。set 去重, concat 平铺。 let res = [...new Set( [].concat(...s.map(m=>m.split('_'))))]; //"", "Co", "Id", "Eq",... 阅读全文
摘要:
同样的装箱引起的性能问题有,使用 List<T> 而不要使用 Array 它在 Add 的时候会装箱。 有些框架里为什么会有装箱工具类?,当装箱无可避免的时候手动装箱一次是比较划算的,比如 int i =0 ; string s = $"1{i}{i}{i}"; 改为 object o = i ;s 阅读全文
摘要:
基元类型: int string object uint long ulong 等 ; FCL (Framework Class Library ) System.Int32 等。 一些定义在一些语言中不太一样,比如 long 在C#里表示64位无符号整型,而 C++ 是 32位。 容易引起混淆,从 阅读全文
摘要:
using System.Diagnostics; namespace ShouldCode.Console { [DebuggerDisplay("Prop1:{Prop1};Prop2:{Prop2};")] public class ShouldDebuggerDisplay { public int Prop1 { get; set; } ... 阅读全文
摘要:
using System; namespace ShouldCode { public interface IShouldBaseNotInterface { bool Show(); } public class A1 : IShouldBaseNotInterface { public bool Show() ... 阅读全文