public class DelimitedStringBuilder
extends java.lang.Object
String
representing a
list of items separated by a delimiter, suppressing
the delimiter after the last element. Examples:StringBuilder
Constructor and Description |
---|
DelimitedStringBuilder(java.lang.String delimiter)
Constructs a
DelimitedStringBuilder with the given delimiter. |
Modifier and Type | Method and Description |
---|---|
void |
append(java.lang.String string)
Appends the given
String followed by the delimiter. |
int |
length()
Returns the number of characters appended so far, including delimiters.
|
void |
reset()
Resets the length to 0.
|
java.lang.String |
toString()
Returns a
String consisting of the appended String s separated by the delimiter. |
public DelimitedStringBuilder(java.lang.String delimiter)
DelimitedStringBuilder
with the given delimiter.delimiter
- The delimiter.public void append(java.lang.String string)
String
followed by the delimiter.string
- The String
to append.public void reset()
public int length()
public java.lang.String toString()
String
consisting of the appended String
s separated by the delimiter.
The final delimiter is suppressed.toString
in class java.lang.Object
String
consisting of the appended String
s separated by the delimiter