nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/standard/string: introduce (an use) `plain_to_s`
[nit.git]
/
lib
/
standard
/
string.nit
diff --git
a/lib/standard/string.nit
b/lib/standard/string.nit
index
2344659
..
aa757b7
100644
(file)
--- a/
lib/standard/string.nit
+++ b/
lib/standard/string.nit
@@
-2220,6
+2220,12
@@
redef class Collection[E]
# Concatenate elements.
redef fun to_s
do
# Concatenate elements.
redef fun to_s
do
+ return plain_to_s
+ end
+
+ # Concatenate element without separators
+ fun plain_to_s: String
+ do
var s = new FlatBuffer
for e in self do if e != null then s.append(e.to_s)
return s.to_s
var s = new FlatBuffer
for e in self do if e != null then s.append(e.to_s)
return s.to_s
@@
-2255,7
+2261,7
@@
end
redef class Array[E]
# Fast implementation
redef class Array[E]
# Fast implementation
- redef fun to_s
+ redef fun plain_to_s
do
var l = length
if l == 0 then return ""
do
var l = length
if l == 0 then return ""