teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

Fix typo

2020/02/14 06:16

投稿

shgtkshruch
shgtkshruch

スコア665

answer CHANGED
@@ -4,10 +4,10 @@
4
4
  def hoge(n)
5
5
  ret = ''
6
6
  unless n == 3
7
- ret.contact "hello"
7
+ ret.concat "hello"
8
8
  end
9
9
  if n == 5
10
- ret.contact"world"
10
+ ret.concat "world"
11
11
  end
12
12
  ret
13
13
  end
@@ -17,6 +17,7 @@
17
17
  str.concat hoge(5)
18
18
 
19
19
  puts str
20
+ => hellohelloworld
20
21
  ```
21
22
  こちらに実際に動くコードをおいていおきます。(ページ上部のRunボタンをクリックすると動きます)
22
23
  [Ruby code](https://repl.it/repls/CalmMisguidedMemoryallocator)