有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何将“abcd1234”转换为INT1234

public class testcount {
    public static void main(String[] args) {

        int c;
         String test = "ABCD1234";

    }
}

我如何从String test转换到int c,答案是1234


共 (1) 个答案

  1. # 1 楼答案

    使用int c = Integer.parseInt(str);将int转换为字符串