0
Given Input. 13-JAN-1982 Output should be. 14-JAN-1982.
Solve this in java
4 Respostas
+ 2
This can be achieved through manipulation. Convert a substring of the first two elements in the input to type Integer, increment that number by one and then this number will be automatically converted back to a String if you concatenate the rest of the input to it. There’s probably more elegant way to do it, but this works.
String input = "13-JAN-1982";
String output = Integer.parseInt(input.substring(0,2))+1+input.substring(2);
System.out.println(output);
0
Thank you so much jake