Find Items in an Array Greater or Less Than a Value
Problem
You have an array and want to find all elements greater or less than a given item or value.
Solution
To find all elements greater or less than a given value, use the –gt, ge, lt, and –le comparison operators:
PS >$array = "Item 1","Item 2","Item 3","Item 1","Item 12" PS >$array ge "Item 3" Item 3 PS >$array lt "Item 3" Item 1 Item 2 Item 1 Item 12
Discussion
- Read more about Find Items in an Array Greater or Less Than a Value
- Log in or register to post comments