Here you can find the source of sortNames(List
Parameter | Description |
---|---|
nameLs | a parameter |
splitStr | a parameter |
private static String sortNames(List<String> nameLs, String splitStr)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import java.util.List; public class Main { /**//from www. j a v a2s .co m * * Sort the List Strings from back to front and split them with split. * * @param nameLs * @param splitStr * @return */ private static String sortNames(List<String> nameLs, String splitStr) { StringBuffer strs = new StringBuffer(); if (!nameLs.isEmpty()) { for (int i = nameLs.size() - 1; i >= 0; i--) { strs.append(nameLs.get(i)); if (i != 0) { strs.append(splitStr); } } } return strs.toString(); } }