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 |