Developing on all versions of the .Net Framework (full, compact and micro) I have always the portability problem and I avoid to use methods that are not available in one of three framework or using directives for precompilation.


It never happened a case where the method exists in all the frameworks but the parameters have a different meaning ... are even reversed !!


The method in question is the overload Regex.Split(String, String, RegexOptions) !


The signature is practically the same comparing the .Net Framework and .Net Micro Framework .... but with a significant difference in the first two parameters.


From the MSDN documentation of the .Net Framework we can read that the first parameter is the string to split while the second is the pattern to be applied.




Conversely, in the MSDN documentation of the .Net Micro Framework we can read that the first is the pattern and the second is the input string !!




To be sure that the error is not in the documentation, I searched the source code of the .Net Micro Framework that implement this method but unfortunately came the confirmation !

   1: /// <summary>
   2: /// Splits the input string at the positions defined by a specified regular expression pattern. Specified options modify the matching operation.
   3: /// </summary>
   4: /// <param name="pattern">The pattern to match against</param>
   5: /// <param name="split">The string to split</param>
   6: /// <param name="options">The options to utilize during matching</param>
   7: /// <returns>The result of splitting the input string against the pattern</returns>
   8: public static string Split(string pattern, string split, RegexOptions options)
   9: {
  10:     return new Regex(pattern, options).Split(split);
  11: }


Absolutely strange ... this time I decided to open an issue on the official website of the .Net Micro Framework on CodePlex !