#BUGFIX by stefan
authorStefan Vogel <sv@exept.de>
Thu, 31 Aug 2017 14:56:26 +0200
changeset 22231 7d56e386be74
parent 22230 74a78be266f9
child 22232 ef8b988ac574
#BUGFIX by stefan class: CharacterArray comment/format in: #copyReplaceString:withString: changed: #copyReplaceAll:with: (send #isString instead of #isByteCollection)
CharacterArray.st
--- a/CharacterArray.st	Thu Aug 31 14:55:20 2017 +0200
+++ b/CharacterArray.st	Thu Aug 31 14:56:26 2017 +0200
@@ -4300,13 +4300,13 @@
 
     "/ ANSI seems to allow a sequence to be replaced by another sequence,
     "/ whereas the old ST80 meant replace all occurrences... - sigh.
-    oldElement isByteCollection ifTrue:[
-        newElement isByteCollection ifTrue:[
+    oldElement isString ifTrue:[
+        newElement isString ifTrue:[
             ^ self copyReplaceString:oldElement withString:newElement.
         ].
         self halt:'check if this is legal'.
     ].
-    newElement isByteCollection ifTrue:[
+    newElement isString ifTrue:[
         self halt:'check if this is legal'.
     ].
     ^ super copyReplaceAll:oldElement with:newElement
@@ -4336,6 +4336,9 @@
      '12345678901234567890' copyReplaceString:'123' withString:'OneTwoThree'
      '12345678901234567890' copyReplaceString:'123' withString:'*'
      '12345678901234567890' copyReplaceString:'234' withString:'foo'
+     '12345678901234567890' asUnicode16String copyReplaceString:'234' asUnicode16String withString:'foo'
+     '12345678901234567890' asUnicode16String copyReplaceString:'234' withString:'foo'
+     '12345678901234567890' asUnicode16String copyReplaceString:'234' withString:'foo' asUnicode16String
 
      ('a string with spaces' copyReplaceAll:$  withAll:' foo ')
         copyReplaceString:'foo' withString:'bar'