Can anybody help me to write ternary operator code for following code
if(s> b)
{
minlength = s.length;
maxlength = b.length;
}
else
{
minlength = b.length;
maxlength = s.length;
}
i have tried the following code but it gives me an error
s.Length > B.Length ? ( minlength = B.Length,maxlength = s.Length ) : ( minlength = s.Length, maxlength = B.Length);
when i use above code it gives an error
"only assignment call increment decrement and new object expressions can be used as a statement"
Can anybody help me to resolve this...