I had this code:
var whackPos = str.IndexOf("/");
...which Resharper recommended be changed to:
var whackPos = str.IndexOf("/", StringComparison.Ordinal);
I see why it is good sometimes, and the different between it and InvariantCulture here, but I don't see why this would be recommended for a little old whack ("/").
Is this really a safer way of finding forwardwhacks, or a case of Resharper being overly persnickety?
UPDATE
For some things, Resharper recommends InvariantCulture. e.g., this code:
percentageQtyShippedCell.Value2 = _percentageOfQtyShipped.ToString();
...was changed to this:
percentageQtyShippedCell.Value2 = _percentageOfQtyShipped.ToString(CultureInfo.InvariantCulture);
...at Resharper's perspicacious proddings. So why does it sometimes opt for InvariantCulture, and other times for Ordinal?