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
Post a Comment