For example, I get the input number LP00001, LP00023, LP00010 in text format. How can I get a number (1, 23, 10) based on the data received, add one, and form, for example, LP00002, LP00024, LP00011?
System.out.printf("%s%05d%n", "LP", i);
it suits me, I don’t understand how I can extract the number itself
I need a number that is for example in LP00032, that is, in fact I should get 32
>Solution :
If LP is a pattern (always 2 characters at the begining of the string), you could do this:
String text = "LP00001";
int numericValue = Integer.parseInt(text.substring(2)) + 1;
System.out.printf("%s%05d%n", "LP", numericValue);