I would like to replace some texts in StringBuilder. How to do this?
In this code I got java.lang.StringIndexOutOfBoundsException at line with mat
java.lang.StringIndexOutOfBoundsException
mat
Lets have a StringBuilder w/ 50 total length and you change the first 20chars to 'x'. So the StringBuilder is shrunk by 19, right - however the initial input pattern.matcher(sb) is not altered, so in the end StringIndexOutOfBoundsException.