Equal Operators:
The equal operators return a value of TRUE if its identical or return a value of FALSE if it is not identical. The entire pattern must match an entire value. By default, all comparison operators are case-insensitive. To make a comparison operator case-sensitive, precede the operator name with a “c”. For example, the case-sensitive version of -eq is -ceq. To make the case-insensitivity explicit, precede the operator with an “i”
Operatorsย | Description |
---|---|
-eq | equals |
-ne | not equals |
-gt | greater than |
-ge | greater than or equal |
-lt | less than |
-le | less than or equal |
Example:
1 2 3 4 5 6 7 8 9 10 11 |
$userName = 'Rakshu' $userName -eq 'rakshu' $userName = 'Aadharsh' $userName -ne 'rakshu' $number1 = 100 $number1 -gt 50 $userName = 100 $userName -le 50 |
Leave A Comment