Here you can find the source of getIndexString(T array, String indexPrefix, String separatorPrefix)
public static <T extends List<V>, V> String getIndexString(T array, String indexPrefix, String separatorPrefix)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static <T extends List<V>, V> String getIndexString(T array, String indexPrefix, String separatorPrefix) { StringBuilder builder = new StringBuilder(); for (int LCV = 0; LCV < array.size(); LCV++) { builder.append(indexPrefix); builder.append(array.get(LCV)); builder.append(separatorPrefix); if (LCV != array.size() - 1) { builder.append(", "); }//from w w w . j a v a 2s.c o m } return builder.toString(); } }