本文介绍了使用System.Text.Encoding.Default.GetString时缺少逗号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用System.Text.Encoding.Default.GetString将二进制数据转换为字符串。但结果是缺少逗号。例如,预期结果是N,A但实际结果是NA。 我的代码如下所示:
Hi, I''m using System.Text.Encoding.Default.GetString to convert binary data to string. But the result is missing comma. For example, the expected result is N,A but the actual result is NA. My code looks like below:
Byte[] wibytes = (Byte[])dr["WI_location"]; String x = System.Text.Encoding.Default.GetString(wibytes); lblEWi.Text = x;请帮忙。 谢谢!
Please help. Thanks!
推荐答案尝试输入一个双/并查看结果。 也尝试输入''\ /''而不是只输入一个/。我说的原因是当你在任何字符前插入\时,它会忽略所遵循的字符的任何特殊行为并完全按原样显示。 Try to input a double / and see the outcome. Also try to input ''\/'' instead of only one /. the reason I say that is when you insert \ in front of any character it ignores any special behaviour by the character that is followed and displays it exactly as it is.
更多推荐
使用System.Text.Encoding.Default.GetString时缺少逗号
发布评论