classe System::Boolean
Contenuti
[
Nascondere
]Boolean class
Classe che conserva i membri statici del tipo System.Boolean .Net.
class Boolean
Metodi
| Metodo | Descrizione |
|---|---|
| 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
| Campo | Descrizione |
|---|---|
| static FalseString | Rappresentazione String del valore booleano ‘false’. |
| static TrueString | Rappresentazione 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
- Namespace System
- Library Aspose.Font for C++