簡體   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