Question: Consider the following snippet:

```
"12-18" -Contains "-"

```

You’d think this evaluates to `true`, but it doesn't. This will evaluate to `false` instead. I’m not sure why this happens, but it does.

To avoid this, you can use this instead:

```
"12-18".Contains("-")

```

Now the expression will evaluate to true.

Why does the first code snippet behave like that? Is there something special about `-` that doesn't play nicely with `-Contains`? [The documentation](http://technet.microsoft.com/en-us/library/hh847759.aspx) doesn't mention anything about it.

Answer: 
`-Contains` is actually a collection operator. It is true if the collection contains the object. It is not limited to strings.

[`-match` and `-imatch`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comparison_operators?view=powershell-6) are regular expression string matchers, and set automatic variables to use with captures.

`-like`, `-ilike` are SQL-like matchers.
* `like` is best, or at least easiest.
* `match` is used for regex comparisons.

Reference: *[About Comparison Operators](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_comparison_operators)*