- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Boolean.Parse() Method in C#
The Boolean.Parse() method in C# is used to convert the specified string representation of a logical value to its Boolean equivalent.
Syntax
Following is the syntax −
public static bool Parse (string val);
Above, the parameter value is a string containing the value to convert.
Example
Let us now see an example to implement the Boolean.Parse() method −
using System; public class Demo { public static void Main(){ bool b; b = bool.Parse("FALSE"); Console.WriteLine("After parsing = "+b); } }
Output
This will produce the following output −
After parsing = False
Example
Let us see another example −
using System; public class Demo { public static void Main(){ bool b; b = bool.Parse(bool.TrueString); Console.WriteLine("After parsing = "+b); } }
Output
This will produce the following output −
After parsing = True
Advertisements