本文介绍了将字符串数组转换为字节数组,然后再转换回vb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
-SA
Each string is converted to array of bytes and back depending on the encoding you want to use, so this is done by the encoding classes: msdn.microsoft/en-us/library/system.text.encoding%28v=vs.110%29.aspx[^].
Apparently, as strings are always Unicode strings, the round trip is guaranteed in all cases only if you use encodings representing Unicode UTFs. As to the array of strings, you can encode the boundaries between strings… any way you prefer. I would advise something more certain if you explained me your purpose. For example, it could be XML markup, or anything else.
—SA
大家好, 我想知道如何将一维字符串数组转换为字节数组并再次返回。我试过在网上搜索,没有答案是我正在寻找的。我真的很绝望,因为我需要这个代码用于我正在构建的数据库。 谢谢, iProgramit
Hi guys, I am wondering how to convert a 1-dimensional array of string to array of bytes and back again. I have tried searching on the web and no answers are what I am looking for. I am really desperate, as I need this code for a database I am building. Thanks, iProgramit
推荐答案每个字符串都会转换为字节数组并返回,具体取决于您要使用的编码,因此这是由编码类完成的:msdn.microsoft/en-us/library/ system.text.encoding%28v = vs.110%29.aspx [ ^ ]。 显然,因为字符串总是Unicode字符串,只有在使用代表Unicode UTF的编码时才能保证往返。对于字符串数组,您可以编码字符串之间的边界...您喜欢的任何方式。如果你向我解释你的目的,我会建议更确定的。例如,它可以是XML标记,或其他任何东西。
更多推荐
将字符串数组转换为字节数组,然后再转换回vb.net
发布评论