Java Iterable to String iterableAsString(Iterable chars)

Here you can find the source of iterableAsString(Iterable chars)

Description

Convert an Iterable of Character s to String.

License

Open Source License

Parameter

Parameter Description
chars the source of characters.

Return

a String containing the chars the iterable returned.

Declaration

public static String iterableAsString(Iterable<Character> chars) 

Method Source Code

//package com.java2s;
// it under the terms of the GNU Lesser General Public License as published by

public class Main {
    /**//w  ww .  j ava2s  . c  om
     * Convert an {@link Iterable} of {@link Character}s to String.
     * 
     * @param chars
     *            the source of characters.
     * @return a String containing the chars the iterable returned.
     */
    public static String iterableAsString(Iterable<Character> chars) {
        StringBuilder builder = new StringBuilder();
        for (Character c : chars) {
            builder.append(c);
        }
        return builder.toString();
    }
}

Related

  1. iterableToString(Iterable iterable)
  2. iterableToString(Iterable list)
  3. iterableToString(Iterable charSequenceIterable)
  4. iterableToString(Iterable itrbl)