473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

List of strings from dictionary

Hi, I'm really struggling with creating a list that takes the keys from a dictionary and puts them into a list.

I know i need set up a variable for the list to return, then use a loop, transfer each key into the list.
Then return the list.

Please Help!

**IM using visual Basic!**
Nov 27 '13 #1
1 3955
Frinavale
9,735 Expert Mod 8TB
You should be able to use the Dictionary's Keys Property to retrieve the keys and put them into a list...

You can take advantage of the List's Constructor that takes an IEnumerable parameter to populate the list with the items you already have.

For example:
Expand|Select|Wrap|Line Numbers
  1. Dim theKeys As New List(Of String)(myDictionary.Keys)
-Frinny
Dec 2 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Steve Perry | last post by:
I have a serialized list and dictionary stored in a file, with the following format: mydata: color origin datasource1 {server:"server1.domain" username:"client" password:"secret"} Is...
2
by: David Pratt | last post by:
Hi. I am wanting to create a tree list result structure from a dictionary to categorize results. The dictionary contains elements that identify its parent. The levels of categorization is not...
0
by: JB | last post by:
Hi All, I was wondering if there was an easy and straightforward way to bind elements in a ListView control, with the corresponding elements in a List or Dictionary. Ideally I'd like a...
2
by: psbasha | last post by:
Hi, How to find whether the list or dictionary is empty?. Thanks PSB
2
by: aspineux | last post by:
Hello I just want to update the data inside List or Dictionary without adding or deleting object. is this correct ? l= for i, v in enumerate(l): l=v+1
15
GTXY20
by: GTXY20 | last post by:
Hi, I have the following in a text file: 1,a 1,b 1,b 2,a 2,c 2,a
4
by: lv191 | last post by:
Hi, Now i raise a question : How to justify a container is a list or dictionary? thank you for your answer ! Ma Shuai
1
by: Simon Brunning | last post by:
2008/8/26 ajak_yahoo <arazak73@yahoo.com.my>: Well, that's a really bad data structure for what you want to do, but you can do it with something like (untested): wanted = 'AE00207' for part...
5
by: =?Utf-8?B?THVpZ2k=?= | last post by:
Hi all, having a List<stringand Dictionary<int, stringhow can I check that every string in the list is also in the Dictionary (and viceversa)? (and raise an exception when not). Thanks in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.