Char.IsSymbol(“*”) is false

前端 未结 3 1801
清酒与你
清酒与你 2020-12-19 02:35

I\'m working on a password validation routine, and am surprised to find that VB does not consider \'*\' to be a symbol per the Char.IsSymbol() check. Here is the output from

3条回答
  •  情歌与酒
    2020-12-19 03:38

    If you simply need to know that character is something else than digit or letter, use just

    !char.IsLetterOrDigit(c) 
    

    preferably with

    && !char.IsControl(c)
    

提交回复
热议问题