System::Boolean クラス

Boolean class

System.Boolean .Net 型の静的メンバーを保持するクラスです。

class Boolean

メソッド

メソッド説明
static Parse(const String&)指定された文字列を bool 型の値に変換します。
static TryParse(const String&, bool&)指定された文字列を bool 型の値に変換します。

フィールド

フィールド説明
static FalseStringString は ‘false’ ブール値の表現です。
static TrueStringString は ’true’ ブール値の表現です。

備考

#include <system/boolean.h>

using namespace System;

int main()
{
  // ブール変数を作成します。
  bool isWeekend = false;

  // 入力文字列を解析し、結果を出力します。
  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
*/

参照