Saturday 15 March 2014

c# - How to get the bool variable in the default case i.e "false" -



c# - How to get the bool variable in the default case i.e "false" -

i have next method:

private string getlicenseid(string arglicenseid, bool istrue) { string licenseid = arglicenseid; if (licenseid != null) { licenseid = licenseid + " " + istrue; } homecoming licenseid; }

when phone call function pass istrue false.

the problem while debugging, istrue has value "false" (note "f" lowercase), when inspect returned value of licenseid, see licenseid concatenated value "false" ("f" uppercase).

my requirement licenseid + "false". although can alter case after getting string, there other solution available? explain me why happening?

true , false normal string conversion of boolean values in .net. seeing (true , false) debugger values. utilize tolower method on string converted boolean.

this method returns constants "true" or "false". note xml case-sensitive, , xml specification recognizes "true" , "false" valid set of boolean values. if string object returned tostring() method written xml file, string.tolower method should called first convert lowercase.

c#

No comments:

Post a Comment