Java List Create createStringFromIntArray( List listOfNumbers)

Here you can find the source of createStringFromIntArray( List listOfNumbers)

Description

create String From Int Array

License

Open Source License

Declaration

public static String createStringFromIntArray(
            List<Integer> listOfNumbers) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2017 JCrypTool Team and Contributors
 * /*from  w  w w  .j  a v a 2  s .c  o m*/
 * All rights reserved. This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/

import java.util.List;

public class Main {
    public static String createStringFromIntArray(
            List<Integer> listOfNumbers) {
        String ret = ("[");
        if (listOfNumbers != null) {
            for (int i = 0; i < listOfNumbers.size(); i++) {
                if (i != listOfNumbers.size() - 1) {
                    ret += (listOfNumbers.get(i));
                    ret += ", ";
                } else {
                    ret += listOfNumbers.get(i);
                }
            }
            ret += "]";
        }
        return ret;
    }
}

Related

  1. createResponse(String inputLabel, List imageLabels)
  2. createSingletonList(T element)
  3. createSourceExtensionList(Map sourceExtensionMap)
  4. createSpaceDelimitedString(List stringList)
  5. createStringDummyList()
  6. createStringFromIntegerList(List lst)
  7. CreateStringList(Collection values)
  8. createStringList(String csvString)
  9. createStringList(String spaceDelimitedString)