Link to home
Start Free TrialLog in
Avatar of steva
steva

asked on

Conditional operator for String.Format in VB.NET?

Is there anything in VB.NET that would let me do something like below?

       Dim mul As Boolean
       Response.Write(String.Format("To get the answer {0} 20 by 5", mul? "multiply" : "divide"))

Here the {0} parameter should become "multiply" if mul is true and "divide" if mul is false.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Zhaolai
Zhaolai
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of steva
steva

ASKER

Yep.  That works.  Thanks.