A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/api/system.boolean.parse below:

Boolean.Parse Method (System) | Microsoft Learn

Boolean.Parse Method Definition Overloads Parse(ReadOnlySpan<Char>)
Source:
Boolean.cs
Source:
Boolean.cs
Source:
Boolean.cs
Source:
Boolean.cs

Converts the specified span representation of a logical value to its Boolean equivalent.

public:
 static bool Parse(ReadOnlySpan<char> value);
public static bool Parse(ReadOnlySpan<char> value);
static member Parse : ReadOnlySpan<char> -> bool
Public Shared Function Parse (value As ReadOnlySpan(Of Char)) As Boolean
Parameters
value
ReadOnlySpan<Char>

A span containing the characters representing the value to convert.

Returns

true if value is equivalent to TrueString; false if value is equivalent to FalseString.

Parse(String)
Source:
Boolean.cs
Source:
Boolean.cs
Source:
Boolean.cs
Source:
Boolean.cs

Converts the specified string representation of a logical value to its Boolean equivalent.

public:
 static bool Parse(System::String ^ value);
public static bool Parse(string value);
static member Parse : string -> bool
Public Shared Function Parse (value As String) As Boolean
Parameters
value
String

A string containing the value to convert.

Returns

true if value is equivalent to TrueString; false if value is equivalent to FalseString.

Exceptions Examples

The following code example illustrates the use of Parse method.

bool val;
string input;

input = bool.TrueString;
val = bool.Parse(input);
Console.WriteLine("'{0}' parsed as {1}", input, val);
// The example displays the following output:
//       'True' parsed as True
let input = bool.TrueString
let value = bool.Parse input
printfn $"'{input}' parsed as {value}"
// The example displays the following output:
//       'True' parsed as True
Dim val As Boolean
Dim input As String

input = Boolean.TrueString
val = Boolean.Parse(input)
Console.WriteLine("'{0}' parsed as {1}", input, val)
' The example displays the following output:
'       'True' parsed as True
Remarks

The value parameter, optionally preceded or trailed by white space, must contain either TrueString or FalseString; otherwise, an exception is thrown. The comparison is case-insensitive.

See also

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4