string value does not match C# with dictionary value -



string value does not match C# with dictionary value -

it weird not know, why below 2 string values not match in code :

string s="textbox1.text= \"hello 1"\"; public static dictionary<string, string> dictionary = new dictionary<string, string>(); dictionary.add("button", "textbox1.text= \"hello 1"\"); dictionary.add("textbox","textbox1.text= \"hello 1"\"); foreach(keyvaluepair<string,string> pair in dictionary) { if(s==pair.value.tostring()) { // code } }

really not know.. reason.

here corrections, worked me, see comments numbers

string s="textbox1.text= \"hello 1\""; //1 dictionary<string, string> dictionary = //2 new dictionary<string, string>(); dictionary.add("button", "textbox1.text= \"hello 1\"");//3 dictionary.add("textbox","textbox1.text= \"hello 1\"");//4 foreach(keyvaluepair<string,string> pair in dictionary) { if(s==pair.value.tostring()) { // code } }

c# string match

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -