Solved

Multi Dimensional Array and C#

Posted on 2014-09-24
6
230 Views
Last Modified: 2014-09-24
Hi,

I have something like the following string. "Smith, Jones, Hughes".

It's comma-delimited. I can split that based on a "," into an array.  

But what I need is a 2 dimensional array after that string is supplied.

So, something like:

Smith
     N
Jones
    N
Hughes
    N

Later in my processing I will change like:

Jones
    Y

Initially, I need to start with a "Smith, Jones, Hughes" but I need to have a single-dimensional array go into a 2 dimensional array where the second dimensional defaults to an "N".

Later, when necessary I will update to a "Y" for an specific first index.

How would/could I do this?

Any information would be greatly appreciated.
0
Comment
Question by:davism
  • 3
  • 3
6 Comments
 
LVL 9

Accepted Solution

by:
dustock earned 500 total points
ID: 40342306
0
 
LVL 1

Author Comment

by:davism
ID: 40342446
I understand I can do it in different means but an array would be more a quick hit type of thing. How can I do it with a 2 dimensional array?
0
 
LVL 1

Author Closing Comment

by:davism
ID: 40342462
Ah, yeah...dictionary would work and not a huge ordeal. I will just go with that.

Thanks!
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 9

Expert Comment

by:dustock
ID: 40342469
Just in case you wanted to know, this question gives a good explanation on how to split your string into a 2d array.

http://www.experts-exchange.com/Programming/Languages/.NET/Q_24166603.html
0
 
LVL 1

Author Comment

by:davism
ID: 40342732
Yeah, I saw that. :-) It's really completely applicable because it's assuming the ":" is already there. I'm putting a "Y" or "N" after the fact.

Thanks though...the dictionary still it working. :-)
0
 
LVL 9

Expert Comment

by:dustock
ID: 40342747
I personally find the dictionary a little bit easier to work with, but there are times where arrays are the way to go.  Glad I was able to help you find a solution.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question