dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet] [bug #26227] too many chunks returned for String.Split(sep


From: Thomas Uxiou
Subject: [Dotgnu-pnet] [bug #26227] too many chunks returned for String.Split(sep, 0)
Date: Sat, 18 Apr 2009 12:04:11 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en; rv:1.9.0.8) Gecko/20080528 Epiphany/2.22 Firefox/3.0

URL:
  <http://savannah.gnu.org/bugs/?26227>

                 Summary: too many chunks returned for String.Split(sep, 0)
                 Project: DotGNU Portable.NET
            Submitted by: uxiou
            Submitted on: Sat Apr 18 12:04:10 2009
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?26227>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]