Solved

Multi Dimensional Array and C#

Posted on 2014-09-24
6
215 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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now