Solved

can I make namevaluecollection with non-comma delimited values

Posted on 2008-10-03
2
518 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

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)…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 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