bugDotGNU Portable.NET - Bugs: bug #26227, too many chunks returned for...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #26227: too many chunks returned for String.Split(sep, 0)

Submitted by:  Thomas Uxiou <uxiou>
Submitted on:  Sat 18 Apr 2009 12:04:10 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Sun 19 Apr 2009 10:45:32 AM UTC, comment #1:

Patch committed to cvs.

Klaus Treichel <ktreichel>
Project Administrator
Sat 18 Apr 2009 12:04:10 PM UTC, original submission:

char[] sep = {'b'};
Console.WriteLine("{0}", "abc".Split(sep, 0).Length);

result:

> 1


expected:

> 0


fix:
# diff a/runtime/System/String.cs b/runtime/System/String.cs
# --- a/runtime/System/String.cs
# +++ b/runtime/System/String.cs
# @@ -1399,10 +1399,7 @@ public sealed class String : IComparable, ICloneable, IEnumerable
# }
# else if(count == 0)
# {
# - // Return the entire string in a single-element array.
# - array = new String [1];
# - array[0] = this;
# - return array;
# + return new String [0];
# }
#
# // Count the number of sub-strings.

Thomas Uxiou <uxiou>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ktreichel (Posted a comment)
  • -unavailable- added by uxiou (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 19 Apr 2009 10:45:32 AM UTCktreichelStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1