字符串转换为bool值,该如何处理

字符串转换为bool值Boolean.Parse(this.RadioButtonList2.SelectedValue.ToString())为什么说该字符串未

字符串转换为bool值
Boolean.Parse(this.RadioButtonList2.SelectedValue.ToString());
为什么说该字符串未被识别为有效的布尔值,


[解决办法]
if( "true ".equals(this.RadioButtonList2.SelectedValue.ToString())) {

bool bo = Convert.ToBoolean( "true ");

} else if ( "false ".equals(this.RadioButtonList2.SelectedValue.ToString())) {

bool bo = Convert.ToBoolean( "false ");

}