C#
public static int Compare (
string strA,
string strB
)
Parameters
strA
The first String. strB
The second String. Return Value
A 32-bit signed integer indicating the lexical relationship between the two comparands.
Value
Condition
Less than zero
strA is less than strB.
Zero
strA equals strB.
Greater than zero
strA is greater than strB.
public static int Compare (
string strA,
string strB
)
Parameters
strA
The first String. strB
The second String. Return Value
A 32-bit signed integer indicating the lexical relationship between the two comparands.
Value
Condition
Less than zero
strA is less than strB.
Zero
strA equals strB.
Greater than zero
strA is greater than strB.
{
boy.Checked=true;
}
else
{
gril.Checked=true;
}
都是字符串,直接if(ss==yy)不就可以了吗?
{
boy.Checked=true;
}
else
{
gril.Checked=true;
}
这样的程序我用了但是不管用一直在显示性别的时候还是不变?
改成:
if(ss.equals(yy))
{
boy.checked = true;
}
else
{
gril.checked = true;
}
{
yy = 男;
boy.checked = true;
}
else
{
yy = 女;
boy.checked = false;}
这样写多好。