Solved

Multi Dimensional Array and C#

Posted on 2014-09-24
6
231 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

685 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