-
-
Save mistyrinth/97cb54e720f361fcf173539f602139b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array = ["りんご", "みかん", "ぶどう"] | |
puts "元の配列は #{array} です" | |
# 要素の置き換え | |
array[1..2] = ["いちご", "さくらんぼ", "もも"] | |
puts "置き換えた後の配列は #{array} です" | |
# 要素の追加 | |
array[1,0] = ["なし"] | |
puts "追加した後の配列は #{array} です" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment