Solved

can I make namevaluecollection with non-comma delimited values

Posted on 2008-10-03
2
511 Views
Last Modified: 2013-11-07
If I build a namevaluecollection by looping through a datatable, the nvc will automatically concatenate new values onto any exisitng ones with the same key. This feature is helpful for they way my data looks, so I'd like to keep the nvc and not try to use a hashtable, for instance.

But some of my values are messages containing commas, which will cause problems when I try to split those values later.

Is there a way to set the nvc's delimiter to be something other than a comma?
0
Comment
Question by:waltraud2000
2 Comments
 
LVL 47

Accepted Solution

by:
Wayne Taylor (webtubbs) earned 300 total points
ID: 22641041
Use the GetValues() method, in conjunction with String.Join to get a delimited string....

    String.Join("|", nvc.GetValues(index:=3))

Note that if you use the GetValues() method, you do not need to split the resulting string, as it returns a string array.

Wayne
0
 

Author Closing Comment

by:waltraud2000
ID: 31503559
Didn't quite solve the problem the way i wanted to, but it was useful nevertheless
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 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

18 Experts available now in Live!

Get 1:1 Help Now