System.Text.Tests.StringBuilderTests.Replace_String C# (CSharp) Method

Replace_String() private method

private Replace_String ( string value, string oldValue, string newValue, int startIndex, int count, string expected ) : void
value string
oldValue string
newValue string
startIndex int
count int
expected string
return void
        public static void Replace_String(string value, string oldValue, string newValue, int startIndex, int count, string expected)
        {
            StringBuilder builder;
            if (startIndex == 0 && count == value.Length)
            {
                // Use Replace(string, string)
                builder = new StringBuilder(value);
                builder.Replace(oldValue, newValue);
                Assert.Equal(expected, builder.ToString());
            }
            // Use Replace(string, string, int, int)
            builder = new StringBuilder(value);
            builder.Replace(oldValue, newValue, startIndex, count);
            Assert.Equal(expected, builder.ToString());
        }
StringBuilderTests