Advertisement

01.02.2008 at 12:37PM PST, ID: 23054094
[x]
Attachment Details

c# split by string delimiter wont work

Asked by jackjohnson44 in Microsoft Visual C#.Net, .Net Editors & IDEs

Tags: delimiter, split, string

I had some code that would use a character as a delimiter.
I found that there was a possibiliyt the character would be in the list so I have to split on a more complicated string.

When I try what is below, it says I can't convert "delim1" from a string to a char.  I don't want to use a char, I want a string and the split overload has string as an option.  Why won't this work?

            string delim1 = "<;>";

            string[] arrSplitContent = strContent.Split(delim1, StringSplitOptions.RemoveEmptyEntries);                  
Start Free Trial
[+][-]01.02.2008 at 12:47PM PST, ID: 20567792

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.02.2008 at 12:56PM PST, ID: 20567900

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, .Net Editors & IDEs
Tags: delimiter, split, string
Sign Up Now!
Solution Provided By: raghx_2000
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.02.2008 at 12:59PM PST, ID: 20567920

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628