Java Array One Dimension to Two Dimension ArrayOutOfMultiDimArray(String _sMultiDimArray[][], int _index)

Here you can find the source of ArrayOutOfMultiDimArray(String _sMultiDimArray[][], int _index)

Description

Array Out Of Multi Dim Array

License

Open Source License

Declaration

public static String[] ArrayOutOfMultiDimArray(String _sMultiDimArray[][], int _index) 

Method Source Code

//package com.java2s;
/*************************************************************************
 * /*from  ww  w . j  ava 2  s.  co  m*/
 *  Copyright 2009 by Giuseppe Castagno beppec56@openoffice.org
 *  
 *  The Contents of this file are made available subject to
 *  the terms of European Union Public License (EUPL) version 1.1
 *  as published by the European Community.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the EUPL.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  EUPL for more details.
 *
 *  You should have received a copy of the EUPL along with this
 *  program.  If not, see:
 *  https://www.osor.eu/eupl, http://ec.europa.eu/idabc/eupl.
 *
 ************************************************************************/

public class Main {
    public static String[] ArrayOutOfMultiDimArray(String _sMultiDimArray[][], int _index) {
        String[] sRetArray = null;
        if (_sMultiDimArray != null) {
            sRetArray = new String[_sMultiDimArray.length];
            for (int i = 0; i < _sMultiDimArray.length; i++) {
                sRetArray[i] = _sMultiDimArray[i][_index];
            }
        }
        return sRetArray;
    }
}

Related

  1. array1dTo2d(float[] in, int firstDim)
  2. array1Dto2D(int m, int n, double[] b)
  3. array1DTo2D(int[] array1D)
  4. array1Dto2D(int[] d1, int imageWidth, int imageHeight)
  5. array2multidim(float[] arr, int width, int height)