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?

お題は不問!Qiita Engineer Festa 2024で記事投稿!
Qiita Engineer Festa20242024年7月17日まで開催中!

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

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?