字符串到十六进制值 [英] string to hex value
本文介绍了字符串到十六进制值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有任何Java实用程序将字符串转换为十六进制值(整数)?
Is there any java utility to convert string to hex value (integer) ?
推荐答案
当您使用以0x或#开头的字符串时
When you have a string starting with 0x or #
Integer.decode(hexStr);
是目标
或
Integer.parseInt(hexString, 16);
这篇关于字符串到十六进制值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文