2002-11-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 13 Nov 2002 18:46:19 +0000 (18:46 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Wed, 13 Nov 2002 18:46:19 +0000 (18:46 -0000)
* StringBuilder.cs: only move the remaining chars in Remove.

svn path=/trunk/mcs/; revision=8973

mcs/class/corlib/System.Text/ChangeLog
mcs/class/corlib/System.Text/StringBuilder.cs

index 7f6f324840810eb3378fa6370d8cd0115f935b50..48ea9117c825d0250f9945c1f88344496700816d 100755 (executable)
@@ -1,3 +1,7 @@
+2002-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+       * StringBuilder.cs: only move the remaining chars in Remove.
+
 2002-11-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * Encoding.cs: unixConsoleEncoding is now the same as Default. Avoid
index 693b3f45188d127448aee848e77293524f543175..050748506c61f8e70ea09c0d8940c577cabf4f5c 100644 (file)
@@ -204,16 +204,16 @@ namespace System.Text {
                        }\r
                }\r
 \r
-               public StringBuilder Remove( int startIndex, int length ) {\r
-                       if( startIndex < 0 || length < 0 || startIndex + length > sLength ) {\r
+               public StringBuilder Remove (int startIndex, int length)\r
+               {\r
+                       if( startIndex < 0 || length < 0 || startIndex + length > sLength )\r
                                throw new ArgumentOutOfRangeException();\r
-                       }\r
 \r
                        // Copy everything after the 'removed' part to the start \r
                        // of the removed part and truncate the sLength\r
 \r
-                       Array.Copy( sString, startIndex + length, sString, \r
-                               startIndex, length );\r
+                       Array.Copy (sString, startIndex + length, sString, startIndex,\r
+                                   sLength - (startIndex + length));\r
 \r
                        sLength -= length;\r
                        return this;\r