Hi all.
*' Middle-left-cell || style="width: 14em;" | Middle-center-cell || Middle-right-cell' self subStrings:'|' ' Middle-left-cell || style="width: 14em;" | Middle-center-cell || Middle-right-cell' self subStrings:'||'*
inspect both, they are identical.
Is this expected behavior?
Looking at the method: char := sourceStream next.
is the "problem" in that a match is had for the single pipe character.
Is there a better way to split that string along double pipes '||' ?
thank you in advance.
-- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html
I found a workaround:
(self copyReplaceTokens: '||' with:'@') subStrings:'@'
Where the copyReplaceTokens: with: message replaces the double pipes. then the subStrings:'@' gives me the result I was looking for:
#(' Middle-left-cell ' ' style="width: 14em;" | Middle-center-cell ' ' Middle-right-cell')
-- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html
explode works too!
' Middle-left-cell || style="width: 14em;" | Middle-center-cell || Middle-right-cell' explode: '||'
an OrderedCollection(' Middle-left-cell ' ' style="width: 14em;" | Middle-center-cell ' ' Middle-right-cell')
make it back into a string with mergeDelimited: ''
:)
All the best,
Ron Teitelbaum
On Thu, Oct 24, 2019 at 12:49 PM tty gettimothy@zoho.com wrote:
I found a workaround:
(self copyReplaceTokens: '||' with:'@') subStrings:'@'
Where the copyReplaceTokens: with: message replaces the double pipes. then the subStrings:'@' gives me the result I was looking for:
#(' Middle-left-cell ' ' style="width: 14em;" | Middle-center-cell ' ' Middle-right-cell')
-- Sent from: http://forum.world.st/Squeak-Beginners-f107673.html _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
beginners@lists.squeakfoundation.org