1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Ruby】文字列をスペースで区切って配列にし、配列の要素を取り出す。

1
Last updated at Posted at 2024-06-13

文字列をスペースで区切って配列にし、配列の要素を取り出すプログラムを作りました
Rubyで作りました。

str1 = "Hello paiza"
array1 = str1.split(' ')
length1 = array1.size()
for i in 0...length1 do
    puts array1[i]
end

結果
kekka.jpg

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?