Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Devops
  3. Question
Devops

How can I clear or empty a StringBuilder?

Asked by Ben Butler Apr 20, 2021 1.9K views 1 answer
Share

About this question

I'm using a StringBuilder in a loop and every x iterations I want to empty it and start with an empty StringBuilder, but I can't see any method similar to the .NET StringBuilder. Clear in the documentation, just the delete method which seems overly complicated. So  how to  clear StringBuilder in Java?

Your answer

1 Answer

More Devops discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest DevOps Blogs

Guides, tips and career advice on DevOps from JanBask experts.