Project

General

Profile

Actions

Feature #2093

closed

String#stripの対象は\sか[:space:]か

Added by naruse (Yui NARUSE) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
[ruby-dev:39322]

Description

=begin
現在、String#strip は rb_enc_isspace を使っています。
つまり、[:space:] にマッチするものを落とすため、
例えばいわゆる全角空白等も切り落とす対象になっています。

しかし、他の Ruby core API は ASCII を意識した動きをすることが多く、
strip はちょっと予想を裏切る動作になっています。

なんとなくただの修正漏れのように感じるのですがどうでしょう?
=end


Related issues 2 (1 open1 closed)

Related to Backport191 - Backport #2477: String#split should be ASCII sensitiveClosedyugui (Yuki Sonoda)Actions
Related to Ruby master - Feature #7845: Strip doesn't handle unicode space characters in ruby 1.9.2 & 1.9.3 (does in 1.9.1)OpenActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0