The coding language is C#3.0
What is the most optimum method to retrieve all hashtable keys into string separated by a delimiter “,”
Is the for loop or the foreach loop the only option?
Update: the keys are already strings
Regards,
naveenj
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do you really mean a non-generic
Hashtable? You could use LINQ, assuming that’s available to you:There may be faster ways, but that’s the way I’d go for the sake of readability. Only micro-optimize when you’ve proved it’s a bottleneck.