小编Wai*_* Oo的帖子

如何在 C# 中将字符串转换为“空终止字节数组”?

假设我的字符串是 "John Doe"

如何将其转换为字节数组

目前我只有将 转换string字节数组的代码,但是如何将 i 转换为空终止字节数组

byte[] bytes = Encoding.ASCII.GetBytes("John Doe");
Run Code Online (Sandbox Code Playgroud)

提前致谢

.net c# arrays type-conversion

3
推荐指数
1
解决办法
188
查看次数

标签 统计

.net ×1

arrays ×1

c# ×1

type-conversion ×1