2

I have to return the text based on the input format used in formula. So, When I used to check String.IndexofAny() in Framework 4.6 it returns -1 even if the character is present.

Example : Formula : =TEXT(TODAY(),"MMMM");

textFormat = "MMMM";

char[] formats = { 'M', 'D', 'Y', 'S', 'T' };

Condition Framework 4.6 .NET50
textFormat.IndexofAny(formats) -1 0

Can someone help me with the exact reason and solution?

1 Answers1

2

In the docs, they have a site about the topic.

Behavior changes when comparing strings on .NET 5+

Alex Fischer
  • 193
  • 1
  • 2
  • 12