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: 
You can use `like`:

```
"12-18" -like "*-*"

```

Or `split` for `contains`:

```
"12-18" -split "" -contains "-"

```
* `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)*