List Info

Thread: Convert Dictionary<> to List<>




Convert Dictionary<> to List<>
user name
2006-06-03 06:07:41
I think this should work for you.


Dictionary<string, int> dictionary = new
Dictionary<string, int>();

dictionary.Add("foo", 2);

dictionary.Add("bar", 1);

IList<int> foo = new
List<int>(dictionary.Values);

I believe this is also the wrong list to be posting such
questions to ...
the Microsoft newsgroups would probably be a better
alternative for you.

Cheers,

Greg Young

On 6/3/06, Robert Rolls <implatformnetspace.net.au> wrote:
>
> I'd like to convert the Dictionary Values to a
List<> anybody know any
> magic
> .net classes/code?
>
>
>
> Rob.
>
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

>



--
If knowledge can create problems, it is not through
ignorance that we can
solve them.

Isaac Asimov

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Convert Dictionary<> to List<>
user name
2006-06-03 22:11:08
On 6/3/06, gregory young <gregoryyoung1gmail.com> wrote:
>
> I believe this is also the wrong list to be posting
such questions to ...
> the Microsoft newsgroups would probably be a better
alternative for you.
>

This list is appropriate for the question.  It is on topic
and there is more
than enough topic expertise on this list to answer such
questions.

--
Steve Johnson

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Convert Dictionary<> to List<>
user name
2006-06-04 00:53:21
Sorry I thought this group was CLR focused.

On 6/3/06, Steve Johnson <sjjohnsonpobox.com> wrote:
>
> On 6/3/06, gregory young <gregoryyoung1gmail.com> wrote:
> >
> > I believe this is also the wrong list to be
posting such questions to
> ...
> > the Microsoft newsgroups would probably be a
better alternative for you.
> >
>
> This list is appropriate for the question.  It is on
topic and there is
> more
> than enough topic expertise on this list to answer such
questions.
>
> --
> Steve Johnson
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

>



--
If knowledge can create problems, it is not through
ignorance that we can
solve them.

Isaac Asimov

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Convert Dictionary<> to List<>
user name
2006-06-04 00:58:55
On 6/3/06, gregory young <gregoryyoung1gmail.com> wrote:
>
> Sorry I thought this group was CLR focused.
>
>
Included in the CLR topic is the .NET Base Class Library, of
which
Dictionary and List are parts.



--
Steve Johnson

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Convert Dictionary<> to List<>
user name
2006-06-04 02:56:40
Dictionary<int, int> dic = new Dictionary<int,
int>();
List<int> list = dic.ToList<int>();

;o)

--
Ernst Kuschke
MVP - C#
http://dotnet.org.za/ernst


On 6/4/06, Steve Johnson <sjjohnsonpobox.com> wrote:
>
> On 6/3/06, gregory young <gregoryyoung1gmail.com> wrote:
> >
> > Sorry I thought this group was CLR focused.
> >
> >
> Included in the CLR topic is the .NET Base Class
Library, of which
> Dictionary and List are parts.
>
> 
>
> --
> Steve Johnson
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

>

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Convert Dictionary<> to List<>
user name
2006-06-05 07:50:15
On 6/4/06, gregory young <gregoryyoung1gmail.com> wrote:
> Sorry I thought this group was CLR focused.

Well, since there's no BCL group, I guess the post was on
topic.

Cheers,
Stoyan

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )