[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 545
  • Last Modified:

can I make namevaluecollection with non-comma delimited values

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
waltraud2000
Asked:
waltraud2000
1 Solution
 
Wayne Taylor (webtubbs)AstronautCommented:
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
 
waltraud2000Author Commented:
Didn't quite solve the problem the way i wanted to, but it was useful nevertheless
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Tackle projects and never again get stuck behind a technical roadblock.
Join Now