Yes. In VB 2008 and above, the If statement is available:
If(x = 7, "SEVEN", "ZERO")
In VB 2005 and below, you need to use the IIf function :
IIf(x = 7, "SEVEN", "ZERO")
(And if your actual code is what you placed exactly, String.Format is completely redundant because it is already a string and you do not need to format it.)
source share