Here you can find the source of concatLineSeparated(List
Parameter | Description |
---|---|
discountCommentCauseList | a list of Strings |
public static String concatLineSeparated(List<String> discountCommentCauseList)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**// w w w . j a va 2 s. co m * Concat a List of Strings separated by a \n\n * * @param discountCommentCauseList a list of Strings * @return a String concatenated and separated by \n\n */ public static String concatLineSeparated(List<String> discountCommentCauseList) { String result = ""; for (String discountCommentCause : discountCommentCauseList) { result += discountCommentCause + "\n\n"; } if (discountCommentCauseList.size() > 0) { result = result.substring(0, result.lastIndexOf("\n\n")); } return result; } }