# 码农类库 **Repository Path**: master-zhou/lib ## Basic Information - **Project Name**: 码农类库 - **Description**: 利用扩展封装常用方法,无须任何引用,只要安装你就能看到各种扩展。 - **Primary Language**: C# - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2017-12-13 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## DNStar.lib(v1.2) 由码农猩球提供用于扩展的类库。 > Install-Package DNStar.lib ## 示例 ```cs var str = "sample"; //原来 if(stirng.IsNullOrEmpty(str)){ ... } //现在 if(str.IsNullOrEmpty()){ ... } //原来 string.Format("this is {0}, maybe has {1}....", name, person); //现在 "this is {0}, maybe has {1} ....".StringFormat(name,person); //这是 C# 6.0 的语法 $"this is {name}, maybe has {person}"; //转换成 base64 字符串 "sample".ToBase64String(); //从 base64string 转换成正常字符串 "YWRtaW5pc3RyYXRvcg==".FromBase64String(); //扩展了对任何数组的遍历 new[]{ 1,2,3,4,5,6,7}.ForEach(item => Console.WriteLine(item)); ``` ## 环境支持 * .NET Framework 4.6.1+ * .NET Core 2.0+, * .NET Standard 2.0+ # [查看文档](https://gitee.com/DotNetStar/lib/wikis/pages)