QuestionQ47

Verified

A tester uses Autopilot in Studio and enters this prompt:

“Get the length of the ‘username’ variable only if it is not null, otherwise return 0.”

Which expression is most likely to be generated from this prompt?

Explanation

The Visual Basic If operator uses short-circuit evaluation. When username IsNot Nothing, it returns username.Length; otherwise, it returns 0 without accessing the length of a null value. (learn.microsoft.com)

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!