I'm using StringBuilder in the repeat. And I'd like to repeat all the x's and empty the contents and write a new String Builder. On dotnet, StringBuilder.Clear Java supports delete but it seems too complicated to me.
Is there an easier way to empty the String Builder?
java stringbuilder
There are two ways.
One is StringBulderObj.setLength(0); and the other is to allocate a new buffer instead of emptying it.
© 2024 OneMinuteCode. All rights reserved.