none
StringSplitOptions not working

    שאלה

  • In my code I have the following line which splits a string into multiple strings using the end-of-line as a seperator:

    string[] reqStringArray = reqString.ToString().Split(new string[] { "\\r\\n" }, StringSplitOptions.RemoveEmptyEntries);

    According to the documentation this function is now supported in the Compact Framework 2 as well, but it doesn't seem to recognize the StringSplitOptions object:

    "The name 'StringSplitOptions' does not exist in the current context"

    The weird thing is that the Intellisense does have the StringSplitOptions object in the list when I type it.

    Any ideas why it is not working?

    יום רביעי 12 אפריל 2006 13:16

תשובות

  • There's no StringSplitOptions and there's no such overload of String.Split() in NETCF, only one overload of Split() is available. IntelliSense shows only one overload of Split(), but there appears to be a documentation bug on MSDN.

    יום רביעי 12 אפריל 2006 20:53

כל התגובות