--- a/CharacterArray.st Mon Nov 20 14:18:04 1995 +0100
+++ b/CharacterArray.st Mon Nov 20 15:34:42 1995 +0100
@@ -34,7 +34,7 @@
!
version
- ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.36 1995-11-11 14:27:38 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.37 1995-11-20 14:34:42 cg Exp $'
!
documentation
@@ -68,6 +68,42 @@
^ (self basicNew:(aString size)) replaceFrom:1 with:aString
"TwoByteString fromString:'hello'"
+!
+
+fromStringCollection:aCollectionOfStrings
+ "return new string formed by concatenating a copy of the argument, aString"
+
+ ^ self fromStringCollection:aCollectionOfStrings separatedBy:''
+
+ "
+ String fromStringCollection:#('hello' 'world' 'how' 'about' 'this')
+ "
+
+ "Created: 20.11.1995 / 15:26:59 / cg"
+!
+
+fromStringCollection:aCollectionOfStrings separatedBy:aSeparatorString
+ "return new string formed by concatenating a copy of the argument, aString"
+
+ |newString first|
+
+ newString := ''.
+ first := true.
+ aCollectionOfStrings do:[:s |
+ first ifFalse:[
+ newString := newString , aSeparatorString
+ ] ifTrue:[
+ first := false
+ ].
+ newString := newString , s
+ ].
+ ^ newString
+
+ "
+ String fromStringCollection:#('hello' 'world' 'how' 'about' 'this') separatedBy:' '
+ "
+
+ "Created: 20.11.1995 / 15:32:17 / cg"
! !
!CharacterArray class methodsFor:'code tables'!