Skip to content

Commit 3a53e99

Browse files
committed
Fixed Sets example
Added scala> prompt, to be consistent with other examples
1 parent fb6d3e8 commit 3a53e99

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

overviews/collections/sets.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ languages: [ja]
1313

1414
* **Tests** `contains`, `apply`, `subsetOf`. The `contains` method asks whether a set contains a given element. The `apply` method for a set is the same as `contains`, so `set(elem)` is the same as `set contains elem`. That means sets can also be used as test functions that return true for the elements they contain.
1515

16-
For example
16+
For example:
1717

1818

19-
val fruit = Set("apple", "orange", "peach", "banana")
20-
fruit: scala.collection.immutable.Set[java.lang.String] =
21-
Set(apple, orange, peach, banana)
19+
scala> val fruit = Set("apple", "orange", "peach", "banana")
20+
fruit: scala.collection.immutable.Set[java.lang.String] = Set(apple, orange, peach, banana)
2221
scala> fruit("peach")
2322
res0: Boolean = true
2423
scala> fruit("potato")

0 commit comments

Comments
 (0)