Is there any Java solution of replacing a digit in a String other than getting the digit using a matcher, increment it by one and replace it?
"REPEAT_FOR_4" will return "REPEAT_FOR_5" "REPEAT_FOR_10" will return "REPEAT_FOR_11"
I would like to do it in one line with regex and replace, not by recomposing the String as "REPEAT_FOR_" and add the number after incrementation. Thank you!
Later edit: I would like to know how to replace a number with the following one in a String.