How can I convert a String
to an int
in Java? 如何在Java中將String
轉換爲int
? spa
My String contains only numbers, and I want to return the number it represents. 個人字符串僅包含數字,我想返回它表明的數字。 .net
For example, given the string "1234"
the result should be the number 1234
. 例如,給定字符串"1234"
,結果應爲數字1234
。 code