Abstract List's toString method to a more general join method on Sequence.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
var str = "string"
|
||||
|
||||
IO.print(str.join("") == str) // expect: true
|
||||
|
||||
IO.print(str.join(", ")) // expect: s, t, r, i, n, g
|
||||
@@ -0,0 +1 @@
|
||||
"string".join(2) // // expect runtime error: Right operand must be a string.
|
||||
Reference in New Issue
Block a user