Project

General

Profile

Feature #14249

Remove str[match_str]

Added by ana06 (Ana Maria Martinez Gomez) almost 3 years ago. Updated over 2 years ago.

Status:
Open
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:84514]

Description

I wonder if str[match_str] makes sense.

"ana"['a'] => "a"

I would say this is not expected and it brings problems, for example when accessing nested hashes. For example:

params = { "user" => "Nicolas Cage" } => {"user"=>"Nicolas Cage"}

params["user"]["age"] => "age"

I think str[regexp] is enough and that str[match_str] can be removed.

Also available in: Atom PDF