sawbona / morelinq

Automatically exported from code.google.com/p/morelinq
Apache License 2.0
0 stars 0 forks source link

ToDelimitedString delimits incorrectly on sequence starting with empty strings #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Call MoreEnumerable.ToDelimitedString on a sequence where the initial 
values of the sequence result in an empty strings.

What is the expected output? What do you see instead?

Expect all values of the sequence to be delimited. Instead values are 
delimited only after the first value in the sequence that results in a non-
empty string.

The following IronPython code illustrates the problem:

IronPython 2.6 (2.6.10920.0) on .NET 2.0.50727.3603
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
>>> clr.AddReference('MoreLinq')
>>> from MoreLinq.MoreEnumerable import ToDelimitedString
>>> print ToDelimitedString(['foo','bar','baz'])
foo,bar,baz
>>> print ToDelimitedString(['foo','','baz'])
foo,,baz
>>> print ToDelimitedString(['','','baz'])
baz
>>>

The last statement, should have resulted in:

,,baz

Original issue reported on code.google.com by azizatif on 18 Jan 2010 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 18 Jan 2010 at 11:31

GoogleCodeExporter commented 9 years ago
Fixed in r135.

Original comment by azizatif on 21 Jan 2010 at 8:42