Solved

Having problems in converting string to an string[]

Posted on 2007-03-21
1
167 Views
Last Modified: 2010-04-16
Hi there

wonder if you can help me?

I have the following in a SQL field

"Launch", "1st", "2nd"

I want to get the value of that field using:

string[] roleoutType =   {systemSettings.displayContent("roleoutType") };

The problem is when I hover over the variable it says:

Dimensions:[1]
and the value of it is "\"Launch\", \"1st\", \"2nd\""

When it should be
Dimensions:[3]

Can someone please help me in getting this to work?

Thanks
Mousemat24
0
Comment
Question by:mousemat24
[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
1 Comment
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
ID: 18764566
use string.Split():

string source= "\"Launch\", \"1st\", \"2nd\"";
string[] parts = source.Split(',');

if you want to remove the quote marks:

string[] parts = source.Replace('"','').Split(',');


0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 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