PaulChavez
2009-06-30 21:09:01 UTC
You can use the Contains() method on a string.
$s = "New York City"
"New","Old" | %{ if ($s.contains($_)) { "$s contains $_" }}
$s = "New York City"
"New","Old" | %{ if ($s.contains($_)) { "$s contains $_" }}
How can I test if a string contains one of several possible strings.
if ($string -match "foo") { Do this; Do That }
I want to know $string contains either "foo" or "bar".
Thanks in advance.
if ($string -match "foo") { Do this; Do That }
I want to know $string contains either "foo" or "bar".
Thanks in advance.