System::Boolean class

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
*/

انظر أيضًا