title: How to convert a range to a delimited string in Java 8+
body: <p>How can you convert a range in Java (either using <code>java.util.stream.LongStream</code> or <code>java.util.stream.IntStream</code>) to a delimited string in Java?</p>
  
  <p>I have tried:</p>
  
  <pre><code>String str = LongStream.range(16, 30)
                  .boxed()
                  .map(String::valueOf)
                  .collect(Collectors.joining(","));
  System.out.println(str);
  </code></pre>
  
  <p>This prints:</p>
  
  <pre><code>16,17,18,19,20,21,22,23,24,25,26,27,28,29
  </code></pre>
  
  <p>The same can be used with <code>IntStream</code>. Is there a more convenient conversion of a range to a delimited string?</p>