<div dir="ltr">I don't know why subStrings: should behave differently for empty fields as non-empty.<div><br></div><div>Before this change, empty fields are ignored:</div><div><br></div><div>    'a:b::d' subStrings: ':'  ==> " #('a' 'b' 'd') "</div><div>    '::::' subStrings: ':' ==> #()</div><div><br></div><div>after this change, empty fields are honored:</div><div><br></div><div>    'a:b::d' subStrings: ':'  ==> " #('a' 'b' '' 'd') "</div><div>    '::::' subStrings: ':' ==>  #('' '' '' '')</div><div><br></div><div>Thoughts?</div><div><br></div><div> - Chris    <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 18, 2022 at 11:14 PM <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Chris Muller uploaded a new version of Collections to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Collections-cmm.1022.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Collections-cmm.1022.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-cmm.1022<br>
Author: cmm<br>
Time: 18 November 2022, 11:14:01.223447 pm<br>
UUID: 9a05d251-4f02-43de-94e8-0f077ec51680<br>
Ancestors: Collections-nice.1021<br>
<br>
Allow empty fields when using #subStrings:.<br>
<br>
=============== Diff against Collections-nice.1021 ===============<br>
<br>
Item was changed:<br>
  ----- Method: String>>subStrings: (in category 'converting') -----<br>
  subStrings: separators <br>
        "Answer an array containing the substrings in the receiver separated <br>
        by the elements of separators."<br>
        | char result sourceStream subString |<br>
-       #Collectn.<br>
-       "Changed 2000/04/08 For ANSI <readableString> protocol."<br>
        (separators isString or:[separators allSatisfy: [:element | element isCharacter]]) ifFalse:<br>
                [^ self error: 'separators must be Characters.'].<br>
        sourceStream := ReadStream on: self.<br>
        result := OrderedCollection new.<br>
        subString := String new.<br>
        [sourceStream atEnd]<br>
                whileFalse: <br>
                        [char := sourceStream next.<br>
                        (separators includes: char)<br>
+                               ifTrue: [result add: subString copy.<br>
+                                                       subString := String new]<br>
-                               ifTrue: [subString notEmpty<br>
-                                               ifTrue: <br>
-                                                       [result add: subString copy.<br>
-                                                       subString := String new]]<br>
                                ifFalse: [subString := subString , (String with: char)]].<br>
        subString notEmpty ifTrue: [result add: subString copy].<br>
        ^ result asArray!<br>
<br>
<br>
</blockquote></div>