我正在学习PowerShell。我想知道如何检查字符串是否包含 PowerShell 数组中的任何子字符串。我知道如何在 Python 中执行相同的操作。以下是代码:
any(substring in string for substring in substring_list)
是否有类似的PowerShell代码可用?
以下是我的PowerShell代码。
$a = @('one', 'two', 'three')
$s = "one is first"
我想用$a中的字符串验证$s。如果$a中的任何字符串存在于$s中,那么返回True。在PowerShell中是否有可能实现?