るりまサーチ

最速Rubyリファレンスマニュアル検索!
15件ヒット [1-15件を表示] (0.039秒)

別のキーワード

  1. kernel exec
  2. kernel system
  3. kernel spawn
  4. kernel open
  5. kernel trace_var

種類

ライブラリ

モジュール

検索結果

Kernel.#chop -> String (39213.0)

$_.chop とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。 コマンドラインオプションで -p または -n を指定した時のみ定義されます。

...$_.chop とほぼ同じですが、置換が発生したときは、$_の内容を置き換える点が異なります。
コマンドラインオプションで -p または -n を指定した時のみ定義されます。

暗号的になりすぎるきらいがあるため、このメソッド...
...な $_.chop を使ってください。

$_.chopとこのメソッド chop は以下の点で違いがあります。

* chop は $_ の値をコピーして、コピーの方を更新し、
$_ に再代入します。

//emlist[例][ruby]{
$_ = "test\r\n"
$_ # => "test\r\n"
chop
...
...# => "test"
$_ = "test\n"
$_ # => "test\n"
chop
# => "test"
$_ = "test"
$_ # => "test"
chop
# => "tes"
//}

@see String#chop,$_...

NEWS for Ruby 3.0.0 (90.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...`true` will cause compaction to occur during major collections. At the moment, compaction adds significant overhead to major collections, so please test first! 17176
* Hash
* Hash#transform_keys and Hash#transform_keys! now accept a hash that maps keys to new keys. 16274
* Hash#except h...
...wait(io, events, timeout)` in a non-blocking execution context. 16786
* Kernel
* Kernel#clone when called with the `freeze: false` keyword will call `#initialize_clone` with the `freeze: false` keyword. 14266
* Kernel#clone when called with the `freeze: true` keyword will call `#initialize...
...ances when called on subclass instances: 10845
* String#*
* String#capitalize
* String#center
* String#chomp
* String#chop
* String#delete
* String#delete_prefix
* String#delete_suffix
* String#downcase
* String#dump
* String#each_cha...