This commit is contained in:
nsnail 2022-11-30 11:51:38 +08:00
parent a0aca21adb
commit 97acd3ea56
2 changed files with 5 additions and 5 deletions

View File

@ -42,11 +42,11 @@ public static class ByteExtensions
/// <param name="upperCase">是否大写</param>
/// <param name="splitShar">字节间分隔符</param>
/// <returns></returns>
public static string String(this byte[] me, bool upperCase = true, char? splitShar = '-')
public static string String(this byte[] me, bool upperCase = true, string splitShar = null)
{
var ret = BitConverter.ToString(me);
if (!upperCase) ret = ret.ToLower();
if (splitShar is not null && splitShar != '-') ret = ret.Replace('-', splitShar.Value);
var ret = BitConverter.ToString(me);
if (!upperCase) ret = ret.ToLower();
if (splitShar != "-") ret = ret.Replace("-", splitShar ?? string.Empty);
return ret;
}
}

View File

@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Version>1.0.5</Version>
<Version>1.0.6</Version>
</PropertyGroup>
<ItemGroup>