I don't know how the contains method is implemented, if it's based off a regex you might try escaping the single-quote with a backslash, e.g.
If that still fails, then I'd be willing to bet the character you're comparing against in the string isn't actually Chr(39).