https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112014-11-04T16:34:52ZRuby Issue Tracking SystemRuby master - Bug #10476: String.strip remove characters different than pure whitespacehttps://redmine.ruby-lang.org/issues/10476?journal_id=497972014-11-04T16:34:52Zyld (Yves Le Douaron)nurachi@gmail.com
<ul></ul><p>With the old 1.8.7 interpreter, the behaviour of strip was different:</p>
<pre><code>1.8.7-head :010 > "#{0.chr}#{9.chr}#{10.chr}#{11.chr}#{12.chr}#{13.chr}#{32.chr}".strip
=> "\000"
1.8.7-head :011 > "#{0.chr}#{9.chr}#{10.chr}#{11.chr}#{12.chr}#{13.chr}#{32.chr}.#{0.chr}".strip
=> "\000\t\n\v\f\r ."
</code></pre>
<p>The null character was stripped from the end of the string but not from the beginning...</p> Ruby master - Bug #10476: String.strip remove characters different than pure whitespacehttps://redmine.ruby-lang.org/issues/10476?journal_id=498012014-11-05T03:16:55Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>As the example in the doc states, "whitespace" includes these characters.</p> Ruby master - Bug #10476: String.strip remove characters different than pure whitespacehttps://redmine.ruby-lang.org/issues/10476?journal_id=498052014-11-05T09:01:19Zyld (Yves Le Douaron)nurachi@gmail.com
<ul></ul><p>The example only includes 4 of these 7 characters, null, form feed and vertical tab are missing.</p>
<p>Maybe a documentation update could be usefull?</p> Ruby master - Bug #10476: String.strip remove characters different than pure whitespacehttps://redmine.ruby-lang.org/issues/10476?journal_id=498112014-11-05T11:43:15Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Category</strong> changed from <i>core</i> to <i>doc</i></li><li><strong>Status</strong> changed from <i>Rejected</i> to <i>Assigned</i></li><li><strong>Assignee</strong> changed from <i>core</i> to <i>zzak (zzak _)</i></li></ul><p>Yes, definitely.</p> Ruby master - Bug #10476: String.strip remove characters different than pure whitespacehttps://redmine.ruby-lang.org/issues/10476?journal_id=499672014-11-15T18:51:14ZAnonymous
<ul><li><strong>File</strong> <a href="/attachments/4873">bug-10476.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/4873/bug-10476.patch">bug-10476.patch</a> added</li></ul><p>How about something like this?</p> Ruby master - Bug #10476: String.strip remove characters different than pure whitespacehttps://redmine.ruby-lang.org/issues/10476?journal_id=500652014-11-24T10:52:34Zyld (Yves Le Douaron)nurachi@gmail.com
<ul></ul><p>It looks perfect.</p> Ruby master - Bug #10476: String.strip remove characters different than pure whitespacehttps://redmine.ruby-lang.org/issues/10476?journal_id=507752015-01-04T03:37:25Zayumin (Ayumu AIZAWA)ayumu.aizawa@gmail.com
<ul><li><strong>Status</strong> changed from <i>Assigned</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>Applied in changeset r49135.</p>
<hr>
<ul>
<li>string.c: improve docs for String#strip and variations. <a href="/issues/10476">[ruby-core:66081]</a>[Bug <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Bug: String.strip remove characters different than pure whitespace (Closed)" href="https://redmine.ruby-lang.org/issues/10476">#10476</a>]</li>
</ul>