Java List Concatenate getZipAndConcatenated(List input1, List input2, String delimiter)

Here you can find the source of getZipAndConcatenated(List input1, List input2, String delimiter)

Description

get Zip And Concatenated

License

Apache License

Declaration

public static String getZipAndConcatenated(List<String> input1, List<String> input2, String delimiter) 

Method Source Code

//package com.java2s;
/*/*  w ww . j a va 2  s  .co  m*/
 * (C) Copyright 2014 Java Test Automation Framework Contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * 
 */

import java.util.List;

public class Main {
    public static String getZipAndConcatenated(List<String> input1, List<String> input2, String delimiter) {
        StringBuffer concatenatedString = new StringBuffer();

        for (int i = 0; i < input1.size(); i++) {
            concatenatedString.append(input1.get(i));
            concatenatedString.append("='");
            if (i < input2.size()) {
                concatenatedString.append(input2.get(i));
            }
            concatenatedString.append("'");
            concatenatedString.append(delimiter);
        }
        return concatenatedString.toString();
    }
}

Related

  1. concatWithSeparator(List list, Object delimiter)
  2. concatWithSeparator(List missingParameters, String separator)
  3. getConcatenatedStringFromList(List input, String delimiter)
  4. getConcatenateString(List codes)
  5. getConcatinatedRange(List numbers)
  6. listToConcatenatedString(List stringList, String delimiter)
  7. toString(List _toString, String _concator)