¿Hay alguna manera de utilizar la declaración Select Case en VB.net para startswith? ¿O tengo que usar un long elseif? Ejemplo:VB.net Select Case Statement with Beginswith
If text.StartsWith("/go") then
elseif test.StartsWith("/stop")
elseif test.StartsWith("/continue")
End If
Pero en lugar algo así como:
Select Case text
Case text.StartsWith("/go")
Case text.StartsWith("/stop")
Case text.StartsWith("/continue")
Case Else
End Select
End Sub
"o tengo que usar un largo elseif" lo que es mucho tiempo sobre elseif en comparación con el caso? Un personaje más De acuerdo, necesita el estado Luego al final de la condición, pero VS lo agregará para que no escriba más de su parte. –
Las respuestas True Case probablemente funcionen, pero parece que el código me huele. ¿Qué logra? –
Creo que es más fácil de leer. –