C# Convert ToBoolean(Char)
Description
Convert ToBoolean(Char)
calling this method always
throws InvalidCastException.
Syntax
Convert.ToBoolean(Char)
has the following syntax.
public static bool ToBoolean(
char value
)
Parameters
Convert.ToBoolean(Char)
has the following parameters.
value
- The Unicode character to convert.
Returns
Convert.ToBoolean(Char)
method returns This conversion is not supported. No value is returned.
Example
/*ww w . java2s.c o m*/
using System;
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(Convert.ToBoolean('a'));
}
}
The code above generates the following result.