PowerShell comparison operators

前端 未结 1 1120
攒了一身酷
攒了一身酷 2021-01-28 18:03

PowerShell has a unique set of comparison operators: -eq -gt -lt -ne etc. I vaguely remember using such operators in a different language, but can\'t recollect which one.

相关标签:
1条回答
  • 2021-01-28 18:40

    The Unix test command for instance uses similar operators. Perl has operators like that too, although without the leading hyphen.

    The reason for PowerShell to use mnemnics rather than symbols for the comparison operators is probably that some of the commonly used comparison symbols are already in use for other operations (= → assignment, > → redirection).

    0 讨论(0)
提交回复
热议问题