Java Iterator implode(Iterator it)

Here you can find the source of implode(Iterator it)

Description

implode

License

Open Source License

Declaration

public static String implode(Iterator it) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Iterator;

public class Main {
    public static String implode(Iterator it) {
        StringBuilder sb = new StringBuilder();
        while (it.hasNext()) {
            sb.append(it.next());//from w w  w . j  a  v a  2 s.  c o m
            sb.append(", ");
        }

        return sb.toString().replaceAll(", +$", "");
    }
}

Related

  1. hasNext(final Iterator it)
  2. hasNextIteration(final Iterator iterator)
  3. hasNexts(List> heads)
  4. hasOpenIteratorsRequiringOpenConnection()
  5. hex(Iterator it)
  6. isBlank(Iterator iterator)
  7. isIterator(Class clazz)
  8. isPrefixOf(Iterator pref, Iterator target)
  9. iterable(Iterator iterator)