[Mono-bugs] [Bug 79672][Cri] New - String.Split incorrect behavior with RemoveEmptyEntries

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Oct 16 12:49:58 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ximian at tlarson.com.

http://bugzilla.ximian.com/show_bug.cgi?id=79672

--- shadow/79672	2006-10-16 12:49:58.000000000 -0400
+++ shadow/79672.tmp.29320	2006-10-16 12:49:58.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 79672
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Critical
+Component: CORLIB
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: ximian at tlarson.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: String.Split incorrect behavior with RemoveEmptyEntries
+
+Description of Problem:
+String.Split returns the wrong number of substrings when using
+StringSplitOptions.RemoveEmptyEntries and specifying a maximum number of
+substrings to return.
+
+Example program to reproduce this bug:
+class TestProgram
+{
+ static void Main()
+  {
+   System.Console.WriteLine(string.Join(", ",
+    "a--b--c-d-e".Split(new char[]{'-'},4,
+    System.StringSplitOptions.RemoveEmptyEntries)));
+  }
+}
+
+Actual Results:
+a, b, -c-d-e
+(3 items returned from Split)
+
+Expected Results:
+a, b, c, d-e
+(4 items returned from Split)
+
+How often does this happen? 
+Always.
+
+Additional Information:
+Microsoft .NET implements this correctly.
+
+I would consider this a "Critical" bug because it's an incorrect
+implementation of a core component, and will cause correctly-written
+applications to behave incorrectly.


More information about the mono-bugs mailing list