0
0

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 5 years have passed since last update.

破壊的メソッド 非破壊的メソッド

Posted at
  • 大元も値を変更するかいなか

破壊的メソッドとは本体のデータを変更する事

- 非破壊的

string = "test code"
string.slice!(0,4)
p string

 "test code"

- 破壊的

string = "test code"
string.slice!(0,4)
p string
 " code"
0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?