x


How do I I convert a hastable to a string?

I've tried

hashtableAsString=myHashtable.toString();

burt that throes an error:'toString' is not a member of 'System.Collections.Hashtable' .Any ideas? Cheers

more ▼

asked Mar 13 '11 at 10:21 PM

Grimmy gravatar image

Grimmy
533 58 64 69

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I think you meant myHashtable.ToString() (note the capital T)? However I am not sure the resulting string is what you're after.

more ▼

answered Mar 13 '11 at 10:25 PM

Statement gravatar image

Statement ♦♦
20.1k 35 70 175

Hmm yeah that just makes a string like "System.Collections.Hashtable". Any idea how I make a string from the data? Should I just go through the dictionary entries and build it manually I guess?

Mar 13 '11 at 10:34 PM Grimmy

Yeah. Just go through the contents and use a StringBuilder to create the string (for efficiency).

Mar 13 '11 at 10:47 PM Statement ♦♦
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x419
x225
x57
x19

asked: Mar 13 '11 at 10:21 PM

Seen: 1776 times

Last Updated: Mar 13 '11 at 10:21 PM