class: StringCollection
authorClaus Gittinger <cg@exept.de>
Fri, 06 Sep 2013 18:01:23 +0200
changeset 15752 fc4ed047850e
parent 15751 e95b462478c6
child 15753 a1e72ab5adfd
class: StringCollection added: #withTabsExpanded: changed: #withTabsExpanded
StringCollection.st
--- a/StringCollection.st	Fri Sep 06 01:16:50 2013 +0200
+++ b/StringCollection.st	Fri Sep 06 18:01:23 2013 +0200
@@ -409,9 +409,29 @@
              new stringCollection (i.e. shared);
              otherwise new strings is created."
 
+    ^ self withTabsExpanded:8
+
+    "
+       |tab|
+       tab := String with:Character tab.
+       ('abcd', tab, 'tef', tab, 'tgh') asStringCollection withTabsExpanded
+    "
+
+    "Created: 12.2.1996 / 22:25:56 / stefan"
+    "Modified: 14.2.1996 / 11:13:01 / stefan"
+    "Modified: 4.3.1996 / 17:10:22 / cg"
+!
+
+withTabsExpanded:n
+    "return a new stringCollection consisting of the receivers lines,
+     where tabs are replaced by space characters (assuming 8-col tabs).
+     Notice: lines which do not contain any tab, are copied by reference to the
+             new stringCollection (i.e. shared);
+             otherwise new strings is created."
+
     ^ self collect:[:string|
         string notNil ifTrue:[
-            string withTabsExpanded     
+            string withTabsExpanded:n     
         ] ifFalse:[
             string
         ]
@@ -442,9 +462,10 @@
 !StringCollection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.46 2012-07-25 17:12:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.47 2013-09-06 16:01:23 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.46 2012-07-25 17:12:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.47 2013-09-06 16:01:23 cg Exp $'
 ! !
+