質問編集履歴
1
question.uppercased() の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -40,6 +40,36 @@
|
|
40
40
|
|
41
41
|
|
42
42
|
|
43
|
+
### 試してみたこと
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
```Swift
|
48
|
+
|
49
|
+
func responseTo(question: String) -> String {
|
50
|
+
|
51
|
+
question.uppercased()
|
52
|
+
|
53
|
+
if question.hasPrefix("hello") {
|
54
|
+
|
55
|
+
return "Why, hello there"
|
56
|
+
|
57
|
+
} else {
|
58
|
+
|
59
|
+
return "That really depends"
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
responseTo(question: "Hello!")
|
68
|
+
|
69
|
+
```
|
70
|
+
|
71
|
+
|
72
|
+
|
43
73
|
|
44
74
|
|
45
75
|
**lowercased(小文字化)**などのメソッドを使って、よりシンプルに作りたいです。
|