ForNext
Only Do What Only You Can Do
101. slice by endpoints, by length
Hyperpolyglot Interpreted Languages: PHP, Perl, Python, Ruby より (2012.05.08)
VBScript
JScript
Perl
select 3rd and 4th elements: @a[2..3] splice(@a, 2, 2)
PHP
select 3rd and 4th elements: none array_slice($a, 2, 2)
Python
select 3rd and 4th elements: a[2:4] none
Ruby
select 3rd and 4th elements: a[2..3] a[2, 2]