Java Array to Delimited String arrayAsString(final int[] _intArray)

Here you can find the source of arrayAsString(final int[] _intArray)

Description

Utility method (debug/test): Trivial helper function for quick trace output.

License

Open Source License

Parameter

Parameter Description
_intArray An array of integers.

Return

Returns a string compiled from the array elements.

Declaration

public static String arrayAsString(final int[] _intArray) 

Method Source Code

//package com.java2s;
/*/*w w  w. j ava2s .c o  m*/
 * Created 2012
 * 
 * This file is part of Topological Data Analysis
 * edu.duke.math.tda
 * TDA is licensed from Duke University.
 * Copyright (c) 2012-2014 by John Harer
 * All rights reserved.
 * 
 */

public class Main {
    /**
     * Utility method (debug/test): Trivial helper function for quick trace output.
     * 
     * @param _intArray An array of integers.
     * 
     * @return Returns a string compiled from the array elements.
     */
    public static String arrayAsString(final int[] _intArray) {

        String strArray = "";

        for (int i = 0; i < _intArray.length; i++)
            strArray += _intArray[i] + " ";

        return strArray;
    }
}

Related

  1. arrayAsCommaSeperatedList(String... items)
  2. arrayToCommaDelimitedString(Object[] arr)
  3. arrayToCommaDelimitedString(Object[] arr)
  4. arrayToCommaDelimitedString(Object[] strings)
  5. arrayToCommaSeparatedString(int[] array)