I wanted to know if anyone know how to get the length of digits, like if the user enters 12345 the computer will return 5 because the length is 5

Sigh...

int i = 123456;

String lengthString = Integer.valueOf(i).toString();

System.out.println(lengthString.length());
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.