Answers for "covert string to bool"

C#
7

how to convert string to bool c#

string sample = "True";
 bool myBool = bool.Parse(sample);

 ///or

 bool myBool = Convert.ToBoolean(sample);
Posted by: Guest on March-19-2020
2

convert string to boolean python

def str2bool(v):

   return str(v).lower() in ("yes", "true", "t", "1")
Posted by: Guest on January-02-2020

C# Answers by Framework

Browse Popular Code Answers by Language