All you have to do is comparing the string to “true”:
//C#
bool mybool = someString == "true";
A lot people forget that the compare operators return a boolean value which you can use in an if-statement or assign it to a variable of type bool.
Some prefer to put some brackets like this:
//C#
bool mybool = (someString == "true");
You can use “System.Convert.ToBoolean(someString)” as well, but keep in mind that it only works with the string “True” or “False” and will throw an exception if it contains anything else. My approach will return always false unless it’s “true”. Keep in mind that you can also check for multiple strings. In this case it’s best to wrap them in a method:
if the value you get, always is "true", you can make an if like this
string valueYouGet="";
//by this line your variable, valueYouGet should be "true", by your own means
bool mybool = false;
if(valueYouGet == "true")
mybool = true;