Is there a VB.net equivalent for C#'s ! operator?

前端 未结 6 1742
旧巷少年郎
旧巷少年郎 2020-12-19 14:02

After two years of C#, I\'m now back to VB.net because of my current job. In C#, I can do a short hand testing for null or false value on a string variable like this:

<
6条回答
  •  攒了一身酷
    2020-12-19 14:41

    c# : boolean example1 = false;

     boolean example2 = !example1;
    

    vb.net: dim example1 as boolean = False

        dim example2 as boolean = Not example1
    

提交回复
热议问题