いつもお世話に合っております。
繰り返しコレクションの各要素の中で、配列{“A”,“B”,“C”,“D”}を使い、条件分岐させたいです。
現在の繰り返し要素itemが、配列{“A”,“B”,“C”,“D”}に含まれているか含まれていないかで条件分岐させたいのですが、どのように条件式を書いたら良いのか分かりません。
教えて頂きたくよろしくお願い致します。
こんにちは
配列をarrStr, itemがString型の場合
arrStr.Contains(item)
になるかと思います。
itemがobjectの場合は、item.ToString としてください
2 Likes
Inside the For Each loop, use an If activity to check if the current item exists in the array:
If activity:
Condition: yourArray.Contains(currentItem.ToString)
If activity (Condition is True):
Then: # Add activities for the True branch
If activity (Condition is False):
Else: # Add activities for the False branch
1 Like
You can check like this:
myArray.Contains(currentItem.ToString)
1 Like
str_Array= {"A","B","C","D"}
- Use For each to iterate through Array.
- Under that use an If Condition
str_Array.Contains(currentItem)
- Print using Message Box.
Hope it helps!!
Regards,
1 Like
@Yoichi 様
@supriya117 様
@rlgandu 様
@Parvathy 様
ありがとうございます。
お陰様で無事に条件分岐することが出来ました。
どうもありがとうございました。
Yoichi様
こちらで躓いておりました。
大変勉強になりました。
ありがとうございました。
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.