Java tutorial
//package com.java2s; import java.util.Collection; public class Main { /** * get minimum length of contained objects toString() * * @param c list of objects * @return the minimum length */ public static int getStringLengthMin(Collection<?> c) { int min = 0; int len; for (Object o : c) { len = o.toString().length(); if (len < min) { min = len; } } return min; } }