Hello Programmers,

is it possible to create new 1D array from 2D array?
for example from this array

String[][] ArrVal= {
{"rec", "02"},
{"proc", "03"},
{"hscode", "10"},
{"sitc", "21"}};

take first column of ArrVal[0] and make this as new array with ArrVal[1] as value of new array, for example :
String[] rec = {"02"}
String[] proc = {"03"}
String[] hscode = {"10"}
String[] sitc = {"21"}

Recommended Answers

All 2 Replies

is it possible to create new 1D array from 2D array?

yes

How to create new array from array 2D member?

iterate over the 2d array and save the desired values from the 2d array to the new array

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.