3rd-Hyperion-Extensions-StringEx.cs
程序员文章站
2022-03-27 12:31:33
...
using System.Runtime.CompilerServices;
namespace Hyperion.Extensions
{
internal static class StringEx
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static byte[] ToUtf8Bytes(this string str)
{
return NoAllocBitConverter.Utf8.GetBytes(str);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static string FromUtf8Bytes(byte[] bytes,int offset, int count)
{
return NoAllocBitConverter.Utf8.GetString(bytes,offset,count);
}
}
}