Java Stream Operation commaSeparated(Stream stream)

Here you can find the source of commaSeparated(Stream stream)

Description

comma Separated

License

Apache License

Declaration

public static String commaSeparated(Stream<String> stream) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Arrays;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Main {
    public static final String LIST_SEPARATOR = ", ";

    public static String commaSeparated(Stream<String> stream) {
        return stream.collect(Collectors.joining(LIST_SEPARATOR));
    }//from  ww  w .j a  v  a 2  s.co  m

    public static String commaSeparated(String[] strings) {
        return commaSeparated(Arrays.stream(strings));
    }
}

Related

  1. buildInvalidArgsError(Stream values, Stream types)
  2. bytesToIntStream(byte[] bytes)
  3. cast(Stream stream, Class type)
  4. cat(Stream... streams)
  5. characterStream2(String s)
  6. concat(IntStream... streams)
  7. concat(Stream... streams)
  8. containsOnly(Stream stream, long size)
  9. createStream(final Iterator iterator)

  10. HOME | Copyright © www.java2s.com 2016