Using C# (with .Net Framework 4.0), how would you extract the value in a hashtable by matching on of its values?
Posted on 2016-11-15
In my C# application using .Net Framework 4.0, I have the following hash table:
Hashtable hashtable = new Hashtable();
hashtable["<"] = 76;
hashtable["("] = 77;
hashtable["&"] = 80;
My program executes the following statement:
string readText = File.ReadAllLines(filePath, Encoding.UTF8);
the first 2 string arrays are as follows:
If I execute the following statement
char value = readText; then I get -> value3| 38 '&'
Do you know how I can take the value in readText, which is an ampersand (&), and look up this value
in the hashtable I have created to find a match on "&" and retrieve the corresponding value 80 from the hashtable and store the result in an int variable titled strRecordSize for future reference in my application?