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


int i = 123456;

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

Be a part of the DaniWeb community

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