请大家给我写一个bool类型的例子!

来源:百度知道 编辑:UC知道 时间:2024/05/23 13:35:24
语言:c shape
最终目的:就是在页面上显示true 或是 false!摆脱了!
哦!一不留神!把拜托打成摆脱了!呵!

public void bool Isture(string str)//传入参数str
{
if (str=="xxx")//判断传入的参数是否符合你的要求。
{
returen true;
}
else
{
returen false;
}
}

//调用
string str="xxx";
if (Isture(str))//判断返回的值是否为真
{
Response.write("true");//为真显示true
}
else
{
Response.write("false");//为假显示false
}

bool f(int i){if(i)return 1;else return 0;}