How can I merge two one dimensional arrays into one two dimensional array?
for example:
arrOne = Split("Apple,Orange,Grape,Lemon", ",")
arrTwo = Split("Green,Orange,Red,Yellow", ",")
arrThree should return:
("Apple", "Green")
("Orange", "Orange")
("Grape", "Red")
("Lemon", "Yellow")
1 7157
Sub Demo()
Dim i As Integer
Dim arrOne() As String, arrTwo() As String
arrOne = Split("Apple,Orange,Grape,Lemon", ",")
arrTwo = Split("Green,Orange,Red,Yellow", ",")
'assuming that each source has the same number of names
ReDim arrDestination(0 To 1, 0 To UBound(arrOne))
For i = 0 To UBound(arrDestination, 2)
arrDestination(0, i) = arrOne(i)
arrDestination(1, i) = arrTwo(i)
Debug.Print arrDestination(0, i), arrDestination(1, i)
Next
End Sub
Sign in to post your reply or Sign up for a free account.
Similar topics
by: mortoray |
last post by:
Throughout the PHP manual, and normal code, one finds this construct:
$var = array( ... );
However, as far as I can tell this is quite inefficient, since it
always means two arrays are being...
|
by: Bernard |
last post by:
How can I cast the dataset
I generated the dataset from schema and named it 'Staff'. I use this dataset (staff dataset) as a datasource in the report
then I would like to generate the data from...
|
by: harborcoat-design |
last post by:
Given the code below I think I should get an alert message box that
says "one" when the link is clicked - but instead i get an error that
"x.1 is null or not an object"
Thanks for any help
-...
|
by: JezB |
last post by:
What's the easiest way to concatenate arrays ? For example, I want a list of
files that match one of 3 search patterns, so I need something like
DirectoryInfo ld = new DirectoryInfo(searchDir);...
|
by: scythetleppo |
last post by:
I am new thanks for the help.
I have a text file set up like this:
word1a<tab>word2a<tab>word3a<tab>word4a
word1b<tab>word2b<tab>word3b<tab>word4b
word1c<tab>word2c<tab>word3c<tab>word4c
I...
|
by: rkk |
last post by:
Hi,
I have written a generic mergesort program which is as below:
---------------------------------------------------------
mergesort.h
-----------------------
void
MergeSort(void...
|
by: Miles |
last post by:
Hi all,
Wondering if anyone can help me. If i have an associative array:
$arr = array(
"one" =array(1, 2, 3),
"two" =array(5, 6),
"three" =array(7,8,9,10)
....
"n" =array(p,q,r....)
|
by: iwl |
last post by:
Hi,
I've tryed to save some data containing empty arrays (array('f')) in a
shelve.
It looks like the shelve has some problems with empty arrays, get
allways:
TypeError: ("'NoneType' object is...
|
by: chiefychf |
last post by:
I'm working on a school project and I am having a few issues... The program calls for three arrays a,b,c that have to be sorted, then compared to even or odd and stored in arrays d & e, then merge...
|
by: pereges |
last post by:
I've an array :
{100,20, -45 -345, -2 120, 64, 99, 20, 15, 0, 1, 25}
I want to split it into two different arrays such that every number <=
50 goes into left array and every number 50 goes...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |