Quantcast
Channel: Fluent Assertions
Viewing all articles
Browse latest Browse all 1402

New Post: myString.Should().Contain("abc") ignoring case

$
0
0

Hi!

What would be the best syntax to check for string containing another string ignoring case?

I see a couple of options:

   myString.Should().Contain("abc", StringComparison.OrdinalIgnoreCase);

or

   myString.Should().ContainIgnoreCase("abc");

First seems more generic but second is shorter, more intellisense-friendly and reads better.

We could have both, second just being just a shortcut for the first.

What do you think?


Viewing all articles
Browse latest Browse all 1402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>