随笔分类 -  C#

摘要:自定义建表方法DataTable public DataTable BuildDataTable(string tablename, params string[] colname) { DataTable dt = new DataTable(); dt.TableName = tablename 阅读全文
posted @ 2022-06-17 16:18 学net的胖子 阅读(995) 评论(0) 推荐(0)
摘要:具体实现 /// <summary> /// 截取某两个字符中间的字符串 /// </summary> /// <param name="str">原始字符串</param> /// <param name="s">开始字符</param> /// <param name="e">结束字符</par 阅读全文
posted @ 2022-06-17 15:55 学net的胖子 阅读(189) 评论(0) 推荐(0)
摘要:var a = "str123$&++"; var b = a.ToCharArray(); for (int i = 0; i < b.Length; i++) { char.IsDigit(b[i]);//十进制数字类别 char.IsLetter(b[i]);//Unicode 字母类别 ch 阅读全文
posted @ 2022-06-16 11:58 学net的胖子 阅读(263) 评论(0) 推荐(0)
摘要:如果想要往Dictionary里面添加相同的Key需要重写IEqualityComparer接口中的Equals方法,代码如下 internal class DicComparer : IEqualityComparer<string> { public bool Equals(string? x, 阅读全文
posted @ 2022-06-16 11:54 学net的胖子 阅读(948) 评论(0) 推荐(0)
摘要:a为用匿名函数嵌套得到的json串 ;将a转为JObject用于下面的组装 var a = JsonConvert.SerializeObject(new { test1 = new string[] { "1", "2", "3" }, test2 = "qwew", test3 = 1234, 阅读全文
posted @ 2022-06-16 09:47 学net的胖子 阅读(358) 评论(0) 推荐(0)