<Asp: linkbutton id = "lbtnadd" runat = "server" style = "text-Decoration: none"> linkbutton without underline </ASP: linkbutton> the blue sentence is OK.
Code1:
Surl. tolower (). startswith ( " Http :// " ) ? Surl :( " Http :// " + Surl)
This sentence means that if Surl uses http: // Otherwise, "http: // "+ Surl
The common method is:
Public String Startwith ( String Surl)
{
If (Surl. startswith ( " Http :// " ))
{
ReturnSurl;
}
Else
{
Return "Http ://" +Surl;
}
}
After comparison, we can find that the above method is more concise.
Code 2:
Bool A, B, C;
Int Nflag = 0 ;
If () {Nflag+ = 1;}
If (B) {Nflag+ = 2;}
If (C) {Nflag+ = 4;}
Switch (Nflag)
{
Case 0 : // (False, false, false)
Break ;
Case 1 : // (True, false, false)
Break ;
Case 2 : // (False, true, false)
Break ;
Case 3 : // (True, true, false)
Break ;
Case 4 : // (False, false, true)
Break ;
Case 5 : // (True, false, true)
Break ;
Case 6 : // (False, true, true)
Break ;
Case 7 : // (True, true, true)
Break ;
}
Usual statement:
Bool A, B, C;
If ()
{
If (B)
{
If (C) {}
Else {}
}
Else
{
If (C) {}
Else {}
}
}
Else
{
If (B)
{
If (C) {}
Else {}
}
Else
{
If (C) {}
Else {}
}
}