繁体   English   中英

你好,我怎样才能将 hexString 转换为 int。 我有“F3A4”,我想编写一个方法或使用 Java_API 来获取 int。 请问我如何编码?

[英]Hallo , how can I convert a hexString to int . I have "F3A4" and i want to write a method or use Java_API to get the int. How code I do it please?

公共 static 无效主(字符串 [] 参数){

诠释一个; 字符串 b = "F22D"; a //我想要“F22D”的int。 请问我该怎么做?

}

您可以使用 function

String b="F22D";
int num=Integer.parseInt(b,16);

//this returns an int value.
 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM