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

maven fortify plugin : Unable to load build session with ID XXXXX .. See log file for more details -

c# - Primavera WebServices does not return any data -

android - Display emoji panel with genymotion - keyboard/touch input? -