Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace String Concatenation with StringBuilder #99

Open
IAmPramod opened this issue Sep 9, 2018 · 1 comment · May be fixed by #98
Open

Replace String Concatenation with StringBuilder #99

IAmPramod opened this issue Sep 9, 2018 · 1 comment · May be fixed by #98

Comments

@IAmPramod
Copy link

No description provided.

@IAmPramod IAmPramod linked a pull request Sep 9, 2018 that will close this issue
@joimxjtuse
Copy link

in practice, i don't always use StringBuilder replace str1 + str2.

  1. str1 + str2, JVM may do this optimize for us (https://stackoverflow.com/questions/1532461/stringbuilder-vs-string-concatenation-in-tostring-in-java), this looks short;
  2. str1+str2+str3+...+strn, StringBuilder looks more clean;
  3. while face for (String s : arrs), always use StringBuilder.append() to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants