All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.psjava.util.IteratorToString Maven / Gradle / Ivy

The newest version!
package org.psjava.util;

import java.util.Iterator;

public class IteratorToString {

	public static  String toString(Iterator iter) {
		StringBuilder sb = new StringBuilder();
		sb.append('(');
		while (iter.hasNext()) {
			T v = iter.next();
			sb.append(v);
			if (iter.hasNext())
				sb.append(',');
		}
		sb.append(')');
		return sb.toString();
	}

	private IteratorToString() {
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy