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
Solved

can I make namevaluecollection with non-comma delimited values

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Import Data from Multiple Text Files in Excel 12 61
location of a form 2 25
Visual studio 2015 1 22
Where is this file? 3 25
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

837 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