
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
Convert the specified string representation of a logical value to its Boolean equivalent in C#
To convert the specified string representation of a logical value to its Boolean equivalent, the code is as follows −
Example
using System; public class Demo { public static void Main(){ bool val; bool flag; val = Boolean.TryParse("true", out flag); Console.WriteLine("Result = "+val); } }
Output
This will produce the following output −
Example
using System; public class Demo { public static void Main() { bool val; bool flag; val = Boolean.TryParse("$", out flag); Console.WriteLine("Result = "+val); } }
Output
This will produce the following output −
Result = False
- Related Articles
- Convert a specified value to an equivalent Boolean value in C#
- Convert the value of the specified string to its equivalent Unicode character in C#
- Convert the ASCII value sentence to its equivalent string in C++
- Convert the value of the specified Decimal to the equivalent 16-bit unsigned integer in C#
- How to convert a boolean value to string value in JavaScript?
- String representation of Boolean in Java
- Convert the specified Windows file time to an equivalent local time in C#
- JavaScript Convert a string to boolean
- Java Program to convert boolean value to Boolean
- C++ Program to convert Boolean Variables into String
- C++ Program to Convert String Type Variables into Boolean
- How to convert a value into Boolean in JavaScript?
- How to convert the string representation of a dictionary to a dictionary in python?
- How to convert Boolean to String in JavaScript?
- How to convert String to Boolean in JavaScript?

Advertisements