2678 |tmpStream idx idx1| |
2678 |tmpStream idx idx1| |
2679 |
2679 |
2680 tmpStream := WriteStream on:(self class new). |
2680 tmpStream := WriteStream on:(self class new). |
2681 idx := 1. |
2681 idx := 1. |
2682 [idx ~~ 0] whileTrue:[ |
2682 [idx ~~ 0] whileTrue:[ |
2683 idx1 := idx. |
2683 idx1 := idx. |
2684 idx := self indexOfSubCollection:subString startingAt:idx. |
2684 idx := self indexOfSubCollection:subString startingAt:idx. |
2685 idx ~~ 0 ifTrue:[ |
2685 idx ~~ 0 ifTrue:[ |
2686 tmpStream nextPutAll:(self copyFrom:idx1 to:idx-1). |
2686 tmpStream nextPutAll:(self copyFrom:idx1 to:idx-1). |
2687 tmpStream nextPutAll:newString. |
2687 tmpStream nextPutAll:newString. |
2688 idx := idx + subString size |
2688 idx := idx + subString size |
2689 ] |
2689 ] |
2690 ]. |
2690 ]. |
2691 tmpStream nextPutAll:(self copyFrom:idx1). |
2691 tmpStream nextPutAll:(self copyFrom:idx1). |
2692 ^ tmpStream contents |
2692 ^ tmpStream contents |
2693 |
2693 |
2694 " |
2694 " |
2695 '12345678901234567890' replString:'123' withString:'OneTwoThree' |
2695 '12345678901234567890' copyReplaceString:'123' withString:'OneTwoThree' |
2696 '12345678901234567890' replString:'123' withString:'*' |
2696 '12345678901234567890' copyReplaceString:'123' withString:'*' |
2697 '12345678901234567890' replString:'234' withString:'foo' |
2697 '12345678901234567890' copyReplaceString:'234' withString:'foo' |
2698 |
2698 |
2699 ('a string with spaces' replChar:$ withString:' foo ') |
2699 ('a string with spaces' copyReplaceAll:$ withAll:' foo ') |
2700 replString:'foo' withString:'bar' |
2700 copyReplaceString:'foo' withString:'bar' |
2701 " |
2701 " |
2702 |
2702 |
2703 "Modified: / 31-05-1999 / 12:33:59 / cg" |
2703 "Modified: / 31-05-1999 / 12:33:59 / cg" |
2704 "Created: / 12-05-2004 / 12:00:00 / cg" |
2704 "Created: / 12-05-2004 / 12:00:00 / cg" |
2705 ! |
2705 ! |