Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Multi Dimensional Array and C#

Posted on 2014-09-24
6
Medium Priority
?
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 9

Accepted Solution

by:
dustock earned 2000 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
Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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.
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

705 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