Skip to content
UPEEC

StringBuilder

A mutable string buffer for efficient concatenation in loops.

Beginner
Comments 0
var sb = new StringBuilder();
for (int v : values) sb.append(v).append(',');
String csv = sb.toString();

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.