Here you can find the source of listToCsvTags(List
Parameter | Description |
---|---|
tags | a parameter |
public static String listToCsvTags(List<String> tagsList)
//package com.java2s; // Licensed to the Apache Software Foundation (ASF) under one import java.util.List; public class Main { /**/* w w w. j a v a 2 s. c om*/ * Converts a List of tags to a comma separated list * * @param tags * @return String containing a comma separated list of tags */ public static String listToCsvTags(List<String> tagsList) { String tags = ""; if (tagsList.size() > 0) { for (int i = 0; i < tagsList.size(); i++) { tags += tagsList.get(i); if (i != tagsList.size() - 1) { tags += ","; } } } return tags; } }