Ruby 3.1 Arrayクラスshift
- shiftは配列の最初の要素を取り除き、その値を返します
a = [0,1,2,3,4]
print a.shift
#=> 0
print a
#=> [1,2,3,4]
Go to list of users who liked
More than 1 year has passed since last update.
Ruby 3.1 Arrayクラスshift
a = [0,1,2,3,4]
print a.shift
#=> 0
print a
#=> [1,2,3,4]
Register as a new user and use Qiita more conveniently
Go to list of users who liked