title: C# string.IndexOf() returns unexpected value
body: <p>This question applies to C#, .net Compact Framework 2 and Windows CE 5 devices.</p>
  
  <p>I encountered a bug in a .net DLL which was in use on very different CE devices for years, without showing any problems. Suddenly, on a new Windows CE 5.0 device, this bug appeared in the following code:</p>
  
  <pre><code>string s = "Print revenue receipt"; // has only single space chars 
  int i = s.IndexOf("  "); // two space chars
  </code></pre>
  
  <p>I expect i to be -1, however this was only true until today, when indexOf suddenly returned 5.</p>
  
  <p>Since this behaviour doesn't occur when using </p>
  
  <pre><code>int i = s.IndexOf("  ", StringComparison.Ordinal);
  </code></pre>
  
  <p>, I'm quite sure that this is a culture based phenomenom, but I can't recognize the difference this new device makes. It is a mostly identical version of a known device (just a faster cpu and new board). </p>
  
  <p>Both devices: </p>
  
  <ul>
  <li>run Windows CE 5.0 with identical localization</li>
  <li>System.Environment.Version reports '2.0.7045.0'</li>
  <li>CultureInfo.CurrentUICulture and CultureInfo.CurrentCulture report 'en-GB' (also tested with 'de-DE')</li>
  <li>'all' related registry keys are equal.</li>
  </ul>
  
  <p>The new device had the CF 3.5 preinstalled, whose GAC files I experimentally renamed, with no change in the described behaviour. Since at runtime always Version 2.0.7045.0 is reported, I assume these assemblies have no effect.</p>
  
  <p>Although this is not difficult to fix, i can not stand it when things seem that magical. Any hints what i was missing?</p>
  
  <p>Edit: it is getting stranger and stranger, see screenshot: 
  <img src="https://i.stack.imgur.com/iGxNb.png" alt="screenshot"></p>
  
  <p>One more:
  <img src="https://i.stack.imgur.com/AJEcj.png" alt="screenshot"></p>