mirror of
https://github.com/nsnail/ns-ext.git
synced 2025-06-21 01:48:15 +08:00
1.0.5
This commit is contained in:
@ -34,4 +34,19 @@ public static class ByteExtensions
|
||||
{
|
||||
return me.HexDe(Encoding.UTF8);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 将字节数组转换成16进制字符串
|
||||
/// </summary>
|
||||
/// <param name="me"></param>
|
||||
/// <param name="upperCase">是否大写</param>
|
||||
/// <param name="splitShar">字节间分隔符</param>
|
||||
/// <returns></returns>
|
||||
public static string String(this byte[] me, bool upperCase = true, char? splitShar = '-')
|
||||
{
|
||||
var ret = BitConverter.ToString(me);
|
||||
if (!upperCase) ret = ret.ToLower();
|
||||
if (splitShar is not null && splitShar != '-') ret = ret.Replace('-', splitShar.Value);
|
||||
return ret;
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>1.0.4</Version>
|
||||
<Version>1.0.5</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Reference in New Issue
Block a user