About 198,000 results
Open links in new tab
  1. Why would you use a StringBuilder method over a String in Java?

    Oct 14, 2021 · What are the benefits of using a StringBuilder method over a String? Why not just amend the content within a String? I understand that a StringBuilder is mutable, but if you …

  2. string - When to use StringBuilder in Java - Stack Overflow

    It is supposed to be generally preferable to use a StringBuilder for string concatenation in Java. Is this always the case? What I mean is this: Is the overhead of creating a StringBuilder object,

  3. How to append a newline to StringBuilder - Stack Overflow

    Jan 26, 2013 · StringBuilder result = new StringBuilder(); result.append(someChar); Now I want to append a newline character to the StringBuilder. How can I do it?

  4. c# - When to use StringBuilder? - Stack Overflow

    Using StringBuilder you modify the actual content of the object without allocating a new one. So use StringBuilder when you need to do many modifications on the string.

  5. java - Why StringBuilder when there is String? - Stack Overflow

    The StringBuilder class is mutable and unlike String, it allows you to modify the contents of the string without needing to create more String objects, which can be a performance gain when …

  6. java: use StringBuilder to insert at the beginning

    May 9, 2011 · The Gist above has the detailed code that anyone can run. I took few ways of growing strings in this; 1) Append to StringBuilder, 2) Insert to front of StringBuilder as as …

  7. String concatenation in Java - when to use +, StringBuilder and …

    Jul 29, 2015 · When should we use + for concatenation of strings, when is StringBuilder preferred and When is it suitable to use concat. I've heard StringBuilder is preferable for concatenation …

  8. c# - String vs. StringBuilder - Stack Overflow

    Sep 16, 2008 · I understand the difference between String and StringBuilder (StringBuilder being mutable) but is there a large performance difference between the two? The program I’m …

  9. How can I clear or empty a StringBuilder? - Stack Overflow

    Mar 4, 2011 · 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 …

  10. c++ - Qt string builder in for loop - Stack Overflow

    The difference between QStringBuilder and C#'s (and Java's) StringBuilder is that the former is not meant to be explicitly instantiated, and lacks the Append () functionality.