System::Boolean class

Boolean class

Kelas yang menyimpan anggota statis dari tipe System.Boolean .Net.

class Boolean

Metode

MetodeDeskripsi
static Parse(const String&)Mengonversi string yang ditentukan ke nilai tipe bool.
static TryParse(const String&, bool&)Mengonversi string yang ditentukan ke nilai tipe bool.

Bidang

BidangDeskripsi
static FalseStringRepresentasi String dari nilai boolean ‘false’.
static TrueStringRepresentasi String dari nilai boolean ’true'.

Catatan

#include <system/boolean.h>

using namespace System;

int main()
{
  // Buat variabel boolean.
  bool isWeekend = false;

  // Parse string masukan dan cetak hasil.
  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
*/

Lihat Juga