Files
HellionChat/ChatTwo/Util/StringUtil.cs
T
2022-02-15 13:02:46 -05:00

14 lines
366 B
C#
Executable File

using System.Text;
namespace ChatTwo.Util;
internal static class StringUtil {
internal static byte[] ToTerminatedBytes(this string s) {
var unterminated = Encoding.UTF8.GetBytes(s);
var bytes = new byte[unterminated.Length + 1];
Array.Copy(unterminated, bytes, unterminated.Length);
bytes[^1] = 0;
return bytes;
}
}