java里 (char)Byte.decode("0x" + new String(new byte[] { src0 })).byteValue()

大海_小鱼 2018-08-19 02:45:01
java里一段代码
(char)Byte.decode("0x" + new String(new byte[] { src0 })).byteValue() 如何在c#中使用 请大神帮忙改下
...全文
230 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xuzuning 2018-08-19
  • 打赏
  • 举报
回复
decode方法将String解码为 Byte
但其原型是,没有你示例的重载
public static Byte decode(String nm) throws NumberFormatException
大海_小鱼 2018-08-19
  • 打赏
  • 举报
回复
引用 1 楼 stherix 的回复:
Convert.ToInt32("0x"+str, 16);
请详细点 感谢
stherix 2018-08-19
  • 打赏
  • 举报
回复
Convert.ToInt32("0x"+str, 16);
xuzuning 2018-08-19
  • 打赏
  • 举报
回复
var b = Regex.Matches(txt, @"\w{2}").Cast<Match>().Select(x => Convert.ToByte(x.Value, 16))。TOArray()
大海_小鱼 2018-08-19
  • 打赏
  • 举报
回复
引用 3 楼 xuzuning 的回复:
decode方法将String解码为 Byte
但其原型是,没有你示例的重载
public static Byte decode(String nm) throws NumberFormatException
可以转换吗老大 如果不能 我就不搞了

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧