Here you can find the source of implode(Vector handler, String separator)
Parameter | Description |
---|---|
handler | a parameter |
separator | a parameter |
public static String implode(Vector handler, String separator)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**// w w w .ja v a2s . c o m * implode, link a vector into a string with a separate string * * @param handler * @param separator * @return String, linked string */ public static String implode(Vector handler, String separator) { StringBuffer strbuf = new StringBuffer(); try { if (!handler.isEmpty()) { int len = handler.size(); for (int loopi = 0; loopi < len; loopi++) { strbuf.append((String) handler.get(loopi)); if (loopi != len - 1) strbuf.append(separator); } } } catch (Exception error) { error.printStackTrace(); } return strbuf.toString(); } }