[ruby-core:93894] [Ruby master Feature#16017] String and Array Slices
From:
FreeKMan@...
Date:
2019-07-23 20:42:26 UTC
List:
ruby-core #93894
Issue #16017 has been updated by D1mon (Dim F). ``` python [1,2,3,4,5][-3:] # [3, 4, 5] [1,2,3,4,5][-3:-1] # [3, 4] ``` ---------------------------------------- Feature #16017: String and Array Slices https://bugs.ruby-lang.org/issues/16017#change-79924 * Author: D1mon (Dim F) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Recently began to study Ruby and lacks some things from the python. I wish they were added to Ruby. ``` python "hello, world!"[3:9:2] # 'l,w' "hello, world!"[3:9] # 'lo, wo' [1,2,3,4,5][1:3] # [2, 3] [1,2,3,4,5][1:5:2] # [2, 4] ``` -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>