classe System::Boolean

Boolean class

Classe che conserva i membri statici del tipo System.Boolean .Net.

class Boolean

Metodi

MetodoDescrizione
static Parse(const String&)Converte la stringa specificata in un valore di tipo bool.
static TryParse(const String&, bool&)Converte la stringa specificata in un valore di tipo bool.

Campi

CampoDescrizione
static FalseStringRappresentazione String del valore booleano ‘false’.
static TrueStringRappresentazione String del valore booleano ’true'.

Osservazioni

#include <system/boolean.h>

using namespace System;

int main()
{
  // Crea la variabile booleana.
  bool isWeekend = false;

  // Analizza la stringa di input e stampa il risultato.
  if (Boolean::TryParse(u"True", isWeekend))
  {
    std::cout << "Is weekend: " << (isWeekend ? "Yes" : "No");
  }
  else
  {
    std::cerr << "Something went wrong" << std::endl;
  }

  return 0;
}
/*
This code example produces the following output:
Is weekend: Yes
*/

Vedi anche