-
Sub-task
-
Resolution: Fixed
-
P3
-
None
-
b100
-
Verified
StringJoiner support prefix and suffix. With parallel operation, it is quite often that two StringJoiner is used and later to merge together, which the prefix, suffix is not wanted.
Propose to add a merge() method to support combining without prefix/suffix.
StringJoiner sj = new StringJoiner(", ", "[", "]");
sj.add("A");
sj.add("B");
otherStringJoiner.add(sj.toString()) // adds "[A,B]"
otherStringJoiner.merge(sj) // adds "A,B"
Propose to add a merge() method to support combining without prefix/suffix.
StringJoiner sj = new StringJoiner(", ", "[", "]");
sj.add("A");
sj.add("B");
otherStringJoiner.add(sj.toString()) // adds "[A,B]"
otherStringJoiner.merge(sj) // adds "A,B"