© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
18 replies
Chris TCC

retrieving dictionary value

I've got a dictionary that stores a string key and a bool as it's value. How do I retrieve the bool value for use in an if-statement? Currently I'm doing this:
bool tempLurkStatus;
if(lurkStatus.TryGetValue(userName, out tempLurkStatus) && tempLurkStatus == true)
bool tempLurkStatus;
if(lurkStatus.TryGetValue(userName, out tempLurkStatus) && tempLurkStatus == true)
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

❔ Should dictionary values be value types (struct)
C#CC# / help
4y ago
✅ Dictionary not returning Value
C#CC# / help
3y ago
Group dictionary by values(?)
C#CC# / help
4y ago
Chunking both key and value from dictionary
C#CC# / help
2y ago