Solved

Having problems in converting string to an string[]

Posted on 2007-03-21
1
161 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
1 Comment
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

772 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

11 Experts available now in Live!

Get 1:1 Help Now