排名
7
文章
192
粉丝
15
评论
16
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术

不确定参数数目使用 params ,再用数组接收
-
- //定义方法的时候参数类型是确定的
- public static string Strformat(this string str, string a, int b, string c)
- {
- return String.Format(str, a, b, c);
- }
- //改过之后
- public static string Strformat<T>(this string str, params object[] items)
- {
- return String.Format(str, items);
- }
评价