Tag: Language Features
All the articles with the tag "Language Features".
-
C# 字符串转字节数组:UTF-8、编码方式与 Span 零分配技巧
Published: at 07:48 AMC# 字符串转字节数组是网络传输、流写入、哈希计算等场景的基础操作。本文覆盖从 Encoding.UTF8.GetBytes() 到 Span<byte>、stackalloc、u8 字面量、MemoryMarshal 的全套方法,并给出选型决策表和常见错误分析。