What you should have written was:

  String s = whatever.stream().collect(joining(", "));

On 8/11/2014 1:31 PM, Pavel Rappo wrote:
Sorry, I should've written this:

          Iterable<?> whatever = ...
          StringJoiner joiner = new StringJoiner(", ");
          whatever.forEach(w -> joiner.add(w.toString()));
          String s = joiner.toString();

-Pavel

On 11 Aug 2014, at 17:17, Pavel Rappo <pavel.ra...@oracle.com> wrote:

        Iterable<?> whatever = ...
        whatever.forEach(w -> builder.append(w.toString());
        String s = builder.toString();

Reply via email to