<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Community support: Inlined changesets</p>
<p><br>
</p>
<p>--- isSeparator.1.cs ---</p>
<p></p>
<div>'From Squeak6.0alpha of 29 April 2021 [latest update: #20483] on 6 May 2021 at 10:21:24 pm'!</div>
<div><br>
</div>
<div>!Character methodsFor: 'testing' stamp: 'ct 5/6/2021 21:41'!</div>
<div>isSeparator</div>
<div><span style="white-space:pre"></span>"Answer whether the receiver is a separator such as space, cr, tab, line feed, or form feed."</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>^ self encodedCharSet isSeparator: self! !</div>
<div><br>
</div>
<div><br>
</div>
<div>!EncodedCharSet class methodsFor: 'character classification' stamp: 'ct 5/6/2021 21:46'!</div>
<div>isSeparator: char</div>
<div><span style="white-space:pre"></span>"Answer whether char has the code of a separator in this encoding."</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>^ self isSeparatorCode: char charCode! !</div>
<div><br>
</div>
<div>!EncodedCharSet class methodsFor: 'character classification' stamp: 'ct 5/6/2021 21:39'!</div>
<div>isSeparatorCode: anInteger</div>
<div><span style="white-space:pre"></span>"Answer whether anInteger is the code of a separator."</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>^ Character separators includesCode: anInteger! !</div>
<div><br>
</div>
<div><br>
</div>
<div>!Unicode class methodsFor: 'character classification' stamp: 'ct 5/6/2021 21:51'!</div>
<div>isSeparatorCode: charCode</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>| cat |</div>
<div><span style="white-space:pre"></span>cat := self generalCategoryOf: charCode.</div>
<div><span style="white-space:pre"></span>^ cat = Cc or: [cat >= Zl and: [cat <= Zs]]! !</div>
<div>------</div>
<div><br>
</div>
<div>--- withAllBlanksTrimmed.1.cs ---</div>
<div>
<div>'From Squeak6.0alpha of 29 April 2021 [latest update: #20483] on 6 May 2021 at 10:24:39 pm'!</div>
<div><br>
</div>
<div>!String methodsFor: 'converting' stamp: 'ct 5/6/2021 21:56'!</div>
<div>withBlanksTrimmed</div>
<div><span style="white-space:pre"></span>"Return a copy of the receiver from which leading and trailing blanks have been trimmed."</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>| first last |</div>
<div><span style="white-space:pre"></span>first := (self findFirst: [:character | character isSeparator not]).</div>
<div><span style="white-space:pre"></span>first = 0 ifTrue: [^ ''].</div>
<div><span style="white-space:pre"></span>"no non-separator character"</div>
<div><span style="white-space:pre"></span>last := self findLast: [:character | character isSeparator not].</div>
<div><span style="white-space:pre"></span>last = 0 ifTrue: [last := self size].</div>
<div><span style="white-space:pre"></span>(first = 1 and: [last = self size]) ifTrue: [^ self copy].</div>
<div><span style="white-space:pre"></span>^ self copyFrom: first to: last! !</div>
<div><br>
</div>
<div><br>
</div>
<div>!StringTest methodsFor: 'tests - converting' stamp: 'ct 5/6/2021 22:00'!</div>
<div>testWithBlanksTrimmed</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>| s |</div>
<div><span style="white-space:pre"></span>self assert: ' abc  d   ' withBlanksTrimmed = 'abc  d'.</div>
<div><span style="white-space:pre"></span>self assert: 'abc  d   ' withBlanksTrimmed = 'abc  d'.</div>
<div><span style="white-space:pre"></span>self assert: ' abc  d' withBlanksTrimmed = 'abc  d'.</div>
<div><span style="white-space:pre"></span></div>
<div><span style="white-space:pre"></span>self assert: (((0 to: 255) collect: [:each | each asCharacter] thenSelect: [:each | each isSeparator]) as: String) withBlanksTrimmed = ''.</div>
<div><span style="white-space:pre"></span></div>
<div><span style="white-space:pre"></span>self assert: '¬†nbsps around¬†' withBlanksTrimmed = 'nbsps around'.</div>
<div><span style="white-space:pre"></span></div>
<div><span style="white-space:pre"></span>s := 'abcd'.</div>
<div><span style="white-space:pre"></span>self assert: s withBlanksTrimmed = s.</div>
<div><span style="white-space:pre"></span>self assert: s withBlanksTrimmed ~~ s! !</div>
<div><br>
</div>
<div><br>
</div>
<div>!Text methodsFor: 'converting' stamp: 'ct 5/6/2021 21:57'!</div>
<div>withBlanksTrimmed</div>
<div><span style="white-space:pre"></span>"Return a copy of the receiver from which leading and trailing blanks have been trimmed."</div>
<div><br>
</div>
<div><span style="white-space:pre"></span>| first last |</div>
<div><span style="white-space:pre"></span>first := string findFirst: [:character | character isSeparator not].</div>
<div><span style="white-space:pre"></span>first = 0 ifTrue: [^ ''].</div>
<div><span style="white-space:pre"></span>"no non-separator character"</div>
<div><span style="white-space:pre"></span>last := string findLast: [:character | character isSeparator not].</div>
<div><span style="white-space:pre"></span>last = 0 ifTrue: [last := self size].</div>
<div><span style="white-space:pre"></span>(first = 1 and: [last = self size]) ifTrue: [^ self copy].</div>
<div><span style="white-space:pre"></span>^ self copyFrom: first to: last! !</div>
</div>
<div>------</div>
<p></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont"></font></div>
</div>
</font></div>
</div>
</div>
</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Thiede, Christoph<br>
<b>Gesendet:</b> Donnerstag, 6. Mai 2021 22:30:56<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> AW: [squeak-dev] [ENH] isSeparator</font>
<div> </div>
</div>
<div>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Hi all,</p>
<p><br>
</p>
<p>here is another tiny changeset, depending on isSeparator.cs: <span>withAllBlanksTrimmed.cs uses the encoding-aware #isSeparator implementation to trim all kinds of spaces correctly from a string.</span></p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">
<div class="x__rp_U4 x_ms-font-weight-regular x_ms-font-color-neutralDark x_rpHighlightAllClass x_rpHighlightBodyClass" id="x_Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="x_divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="x_Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody"><br>
</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Best,</div>
<div class="x__rp_T4" id="x_Item.MessagePartBody">Christoph</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Thiede, Christoph<br>
<b>Gesendet:</b> Donnerstag, 6. Mai 2021 22:27:57<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] [ENH] isSeparator</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Hi all,<br>
<br>
here is one tiny changeset for you: isSeparator.cs adds proper encoding-aware support for testing of separator chars. As opposed to the former implementation, non-ASCII characters such as the no-break space (U+00A0) will be identified correctly now, too.<br>
<br>
Please review and merge! :-)<br>
<br>
Best,<br>
Christoph<br>
<br>
["isSeparator.cs.gz"]</div>
</span></font></div>
</body>
</html>