2 String collections to two-dimensional array

Z

Zaur Bahramov

Hi!
I have 2 stringcollections each produced by Regex. One StringCollection
contains IDs and another descriptions. Is it possible to use CopyTo or
some other method to import these two collections to two-dimensional array?

Many thanks in advance for your help!
 
Z

Zaur Bahramov

Mark said:
How do the elements of the two string collections relate to each other...?

Also, I would suggest that you forget about arrays and use a generic
Dictionary instead:
http://msdn.microsoft.com/en-us/library/xfhwa508.aspx

Both strings are stripped by regex from the same source and contain the
same ID.

If the original source string looks like this:
['ABC1']=['some','text','is','here'];
['ABC2']=['some','text','is','here']
['ABC3']=['some','text','is','here']

then wioth the regex I pulled two separate StringCollections.

str1 contains all three ABC[1-3] parts
Str2 contains whatever follows '=' sign.

I thought about creating an array that will look like following:

[ABC1, ('some','text','is','here')]
[ABC2, ('some','text','is','here')]
[ABC3, ('some','text','is','here')]

Thank you for your suggestion, Dictionary looks better for this problem.
I will try it :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top