エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
Ruby 2.6 adds String#split with block
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
Ruby 2.6 adds String#split with block
Before Ruby 2.6, String#split returned array of split strings. In Ruby 2.6, a block can be passed... Before Ruby 2.6, String#split returned array of split strings. In Ruby 2.6, a block can be passed to String#split (Link is not available) which yields each split string and operates on it. This avoids creating an array and thus is memory efficient. We will add method is_fruit? to understand how to use split with a block. 1def is_fruit?(value) 2%w(apple mango banana watermelon grapes guava lychee).