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