StringCollection.st
branchjv
changeset 18097 52f3ca7a321f
parent 18011 deb0c3355881
parent 15753 a1e72ab5adfd
child 18120 e3a375d5f6a8
equal deleted inserted replaced
18096:698883672d5c 18097:52f3ca7a321f
   407      where tabs are replaced by space characters (assuming 8-col tabs).
   407      where tabs are replaced by space characters (assuming 8-col tabs).
   408      Notice: lines which do not contain any tab, are copied by reference to the
   408      Notice: lines which do not contain any tab, are copied by reference to the
   409              new stringCollection (i.e. shared);
   409              new stringCollection (i.e. shared);
   410              otherwise new strings is created."
   410              otherwise new strings is created."
   411 
   411 
       
   412     ^ self withTabsExpanded:8
       
   413 
       
   414     "
       
   415        |tab|
       
   416        tab := String with:Character tab.
       
   417        ('abcd', tab, 'tef', tab, 'tgh') asStringCollection withTabsExpanded
       
   418     "
       
   419 
       
   420     "Created: 12.2.1996 / 22:25:56 / stefan"
       
   421     "Modified: 14.2.1996 / 11:13:01 / stefan"
       
   422     "Modified: 4.3.1996 / 17:10:22 / cg"
       
   423 !
       
   424 
       
   425 withTabsExpanded:n
       
   426     "return a new stringCollection consisting of the receivers lines,
       
   427      where tabs are replaced by space characters (assuming n-col tabs).
       
   428      Notice: lines which do not contain any tab, are copied by reference to the
       
   429              new stringCollection (i.e. shared);
       
   430              otherwise new strings is created."
       
   431 
   412     ^ self collect:[:string|
   432     ^ self collect:[:string|
   413         string notNil ifTrue:[
   433         string notNil ifTrue:[
   414             string withTabsExpanded     
   434             string withTabsExpanded:n     
   415         ] ifFalse:[
   435         ] ifFalse:[
   416             string
   436             string
   417         ]
   437         ]
   418     ]
   438     ]
   419 
   439 
   440 ! !
   460 ! !
   441 
   461 
   442 !StringCollection class methodsFor:'documentation'!
   462 !StringCollection class methodsFor:'documentation'!
   443 
   463 
   444 version
   464 version
   445     ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.46 2012-07-25 17:12:38 cg Exp $'
   465     ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.48 2013-09-06 16:01:40 cg Exp $'
   446 !
   466 !
   447 
   467 
   448 version_CVS
   468 version_CVS
   449     ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.46 2012-07-25 17:12:38 cg Exp $'
   469     ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.48 2013-09-06 16:01:40 cg Exp $'
   450 ! !
   470 ! !
       
   471