今回は包含演算子について説明したいと思います。
包含演算子は、コレクション内に指定した値が含まれているかどうかをTRUE/FALSEで返す演算子で、下記の2つがあります。
演算子の先頭に"i"をつけた場合(-icontains および -inotcontains)と先頭に何も文字を付加しない場合(-contains, -notcontains)は大文字と小文字を区別しません。また、演算子の先頭に"c"を付けた場合(-ccontains, -cnotcontains)は大文字と小文字を区別します。
下記は数値1,2,3,4,5のいずれかに3が含まれているかを評価します。1,2,3,4,5のコレクションには3が含まれているのでTrueが返されます。
PS > 1,2,3,4,5 -contains 3 True
また、下記はコレクションの中に"BANANA"が含まれているかを評価します。
PS > "ORANGE","BANANA","GRAPES" -contains "BANANA" True
Theme design by Jelle Druyts
Pick a theme: BlogXP business calmBlue Candid Blue dasBlog dasblogger DirectionalRedux Discreet Blog Blue Elegante essence Just Html MadsSimple Mobile Mono Movable Radio Blue Movable Radio Heat nautica022 orangeCream Portal Project84 Project84Grass Slate Sound Waves Tricoleur useit.com Voidclass2 BlogXP business calmBlue Candid Blue dasBlog dasblogger DirectionalRedux Discreet Blog Blue Elegante essence Just Html MadsSimple Mobile Mono Movable Radio Blue Movable Radio Heat nautica022 orangeCream Portal Project84 Project84Grass Slate Sound Waves Tricoleur useit.com Voidclass2
Powered by: newtelligence dasBlog 2.0.7226.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2009, HIRO
E-mail