Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StringBuilder.Replace with ReadOnlySpan<char> #93938

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -1841,6 +1841,17 @@
/// </remarks>
public StringBuilder Replace(string oldValue, string? newValue) => Replace(oldValue, newValue, 0, Length);

/// <summary>
/// Replaces all instances of one read-only character span with another in this builder.
TheMaximum marked this conversation as resolved.
Show resolved Hide resolved
/// </summary>
/// <param name="oldValue">The read-only character span to replace.</param>
/// <param name="newValue">The read-only character span to replace <paramref name="oldValue"/> with.</param>
/// <remarks>
/// If <paramref name="newValue"/> is <c>null</c>, instances of <paramref name="oldValue"/>
adamsitnik marked this conversation as resolved.
Show resolved Hide resolved
/// are removed from this builder.
/// </remarks>
public StringBuilder Replace(ReadOnlySpan<char> oldValue, ReadOnlySpan<char> newValue) => Replace(oldValue, newValue, 0, Length);

/// <summary>
/// Determines if the contents of this builder are equal to the contents of another builder.
/// </summary>
Expand Down Expand Up @@ -1950,6 +1961,25 @@
/// are removed from this builder.
/// </remarks>
public StringBuilder Replace(string oldValue, string? newValue, int startIndex, int count)
{
ArgumentException.ThrowIfNullOrEmpty(oldValue);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be ThrowIfNull. The called method has the check for empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would change the exception message (I think) in case it's an empty string (SR.Arg_EmptySpan instead of SR.Argument_EmptyString), I don't know if that would be an issue? It might be confusing to the user who's using strings to get an exception message indicating an empty span?


Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_AllConfigurations)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Runtime_Release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build linux-x64 release Runtime_Release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x86 checked CoreCLR_NoR2R)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-armel checked CoreCLR_NonPortable)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm Debug AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug AllSubsets_Mono_LLVMJIT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono Product Build linux arm64 debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug AllSubsets_Mono_LLVMJIT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-riscv64 Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono Product Build linux x64 debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release AllSubsets_Mono_LLVMAOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm Release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build wasi-wasm linux Release LibraryTests_Smoke)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono Product Build linux x64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build browser-wasm linux release Runtime_Release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl arm64 Release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono llvmaot Product Build linux x64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux_musl x64 Debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm Release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux x64 Debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux arm64 Debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build linux x64 Release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build freebsd x64 Debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build android-arm64 Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build android-arm Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono Product Build linux arm64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release AllSubsets_Mono_LLVMAOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_AOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug NativeAOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release AllSubsets_Mono_LLVMAot_RuntimeTests llvmaot)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_EAT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build coreclr Common Pri0 Test Build AnyOS AnyCPU checked)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono llvmaot Product Build linux arm64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build mono Common Pri0 Test Build AnyOS AnyCPU release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_Threading_Smoke)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvossimulator-x64 Debug AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux_musl arm release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux_musl arm checked)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux arm release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release NativeAOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release NativeAOT_Libraries)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release NativeAOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked CLR_Tools_Tests)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux arm checked)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux riscv64 checked)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux_musl arm64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux_musl x64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux arm64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux x64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build freebsd x64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux arm64 checked)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux_musl arm64 checked)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux x64 checked)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build linux_musl x64 checked)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build osx-arm64 release Runtime_Debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build osx-x64 release Runtime_Debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build osx-x64 release Runtime_Release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono crossaot Product Build linux x64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_LLVMJIT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build maccatalyst-x64 Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono crossaot Product Build linux_musl arm64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 checked Native_GCC)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono crossaot Product Build linux_musl x64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug AllSubsets_Mono_LLVMAOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono crossaot Product Build linux arm64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono Product Build osx x64 debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx arm64 Debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_Interpreter_RuntimeTests monointerpreter)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Libraries Build osx x64 Debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvos-arm64 Release AllSubsets_NativeAOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono Product Build osx x64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build ios-arm64 Release AllSubsets_NativeAOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build ios-arm64 Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build Mono Product Build osx arm64 debug)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvos-arm64 Release AllSubsets_Mono)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release NativeAOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build osx x64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_Minijit_RuntimeTests minijit)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Release NativeAOT)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Release NativeAOT_Libraries)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build osx arm64 checked)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build osx arm64 release)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime (Build CoreCLR Product Build osx x64 checked)

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)

Check failure on line 1966 in src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs#L1966

src/libraries/System.Private.CoreLib/src/System/Text/StringBuilder.cs(1966,1): error SA1028: (NETCORE_ENGINEERING_TELEMETRY=Build) Code should not contain trailing whitespace (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1028.md)
ReadOnlySpan<char> newValueSpan = (newValue == null) ? ReadOnlySpan<char>.Empty : newValue.AsSpan();
return Replace(oldValue.AsSpan(), newValueSpan, startIndex, count);
TheMaximum marked this conversation as resolved.
Show resolved Hide resolved
}

/// <summary>
/// Replaces all instances of one read-only character span with another in part of this builder.
/// </summary>
/// <param name="oldValue">The read-only character span to replace.</param>
/// <param name="newValue">The read-only character span to replace <paramref name="oldValue"/> with.</param>
/// <param name="startIndex">The index to start in this builder.</param>
/// <param name="count">The number of characters to read in this builder.</param>
/// <remarks>
/// If <paramref name="newValue"/> is <c>null</c>, instances of <paramref name="oldValue"/>
adamsitnik marked this conversation as resolved.
Show resolved Hide resolved
/// are removed from this builder.
/// </remarks>
public StringBuilder Replace(ReadOnlySpan<char> oldValue, ReadOnlySpan<char> newValue, int startIndex, int count)
{
int currentLength = Length;
if ((uint)startIndex > (uint)currentLength)
Expand All @@ -1960,9 +1990,10 @@
{
throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_IndexMustBeLessOrEqual);
}
ArgumentException.ThrowIfNullOrEmpty(oldValue);

newValue ??= string.Empty;
if (oldValue.Length == 0)
{
throw new ArgumentException(SR.Arg_EmptySpan, nameof(oldValue));
}

var replacements = new ValueListBuilder<int>(stackalloc int[128]); // A list of replacement positions in a chunk to apply

Expand Down Expand Up @@ -2225,7 +2256,7 @@
/// <remarks>
/// This routine is very efficient because it does replacements in bulk.
/// </remarks>
private void ReplaceAllInChunk(ReadOnlySpan<int> replacements, StringBuilder sourceChunk, int removeCount, string value)
private void ReplaceAllInChunk(ReadOnlySpan<int> replacements, StringBuilder sourceChunk, int removeCount, ReadOnlySpan<char> value)
{
Debug.Assert(!replacements.IsEmpty);

Expand All @@ -2251,7 +2282,7 @@
while (true)
{
// Copy in the new string for the ith replacement
ReplaceInPlaceAtChunk(ref targetChunk!, ref targetIndexInChunk, ref value.GetRawStringData(), value.Length);
ReplaceInPlaceAtChunk(ref targetChunk!, ref targetIndexInChunk, ref MemoryMarshal.GetReference<char>(value), value.Length);
int gapStart = replacements[i] + removeCount;
i++;
if ((uint)i >= replacements.Length)
Expand Down Expand Up @@ -2289,7 +2320,7 @@
/// <param name="indexInChunk">The index in <paramref name="chunk"/> at which the substring starts.</param>
/// <param name="count">The logical count of the substring.</param>
/// <param name="value">The prefix.</param>
private bool StartsWith(StringBuilder chunk, int indexInChunk, int count, string value)
private bool StartsWith(StringBuilder chunk, int indexInChunk, int count, ReadOnlySpan<char> value)
{
for (int i = 0; i < value.Length; i++)
{
Expand Down
2 changes: 2 additions & 0 deletions src/libraries/System.Runtime/ref/System.Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14925,6 +14925,8 @@ public void CopyTo(int sourceIndex, System.Span<char> destination, int count) {
public System.Text.StringBuilder Replace(char oldChar, char newChar, int startIndex, int count) { throw null; }
public System.Text.StringBuilder Replace(string oldValue, string? newValue) { throw null; }
public System.Text.StringBuilder Replace(string oldValue, string? newValue, int startIndex, int count) { throw null; }
public System.Text.StringBuilder Replace(ReadOnlySpan<char> oldValue, ReadOnlySpan<char> newValue) { throw null; }
public System.Text.StringBuilder Replace(ReadOnlySpan<char> oldValue, ReadOnlySpan<char> newValue, int startIndex, int count) { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
public string ToString(int startIndex, int length) { throw null; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,84 @@ public static void Replace_String_Invalid()
AssertExtensions.Throws<ArgumentOutOfRangeException>("count", () => builder.Replace("a", "b", 4, 2)); // Count + start index > builder.Length
}

[Theory]
[InlineData("", "a", "!", 0, 0, "")]
[InlineData("aaaabbbbccccdddd", "a", "!", 0, 16, "!!!!bbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "a", "!", 2, 3, "aa!!bbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "a", "!", 4, 1, "aaaabbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "aab", "!", 2, 2, "aaaabbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "aab", "!", 2, 3, "aa!bbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "aa", "!", 0, 16, "!!bbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "aa", "$!", 0, 16, "$!$!bbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "aa", "$!$", 0, 16, "$!$$!$bbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "aaaa", "!", 0, 16, "!bbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "aaaa", "$!", 0, 16, "$!bbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "a", "", 0, 16, "bbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "b", null, 0, 16, "aaaaccccdddd")]
[InlineData("aaaabbbbccccdddd", "aaaabbbbccccdddd", "", 0, 16, "")]
[InlineData("aaaabbbbccccdddd", "aaaabbbbccccdddd", "", 16, 0, "aaaabbbbccccdddd")]
[InlineData("aaaabbbbccccdddd", "aaaabbbbccccdddde", "", 0, 16, "aaaabbbbccccdddd")]
[InlineData("aaaaaaaaaaaaaaaa", "a", "b", 0, 16, "bbbbbbbbbbbbbbbb")]
public static void Replace_CharSpan(string value, string oldValue, string newValue, int startIndex, int count, string expected)
{
StringBuilder builder;
if (startIndex == 0 && count == value.Length)
{
// Use Replace(ReadOnlySpan<char>, ReadOnlySpan<char>)
builder = new StringBuilder(value);
builder.Replace(oldValue.AsSpan(), newValue.AsSpan());
Assert.Equal(expected, builder.ToString());
}
// Use Replace(ReadOnlySpan<char>, ReadOnlySpan<char>, int, int)
builder = new StringBuilder(value);
builder.Replace(oldValue.AsSpan(), newValue.AsSpan(), startIndex, count);
Assert.Equal(expected, builder.ToString());
}

[Fact]
public static void Replace_CharSpan_StringBuilderWithMultipleChunks()
{
StringBuilder builder = StringBuilderWithMultipleChunks();
builder.Replace("a".AsSpan(), "b".AsSpan(), builder.Length - 10, 10);
Assert.Equal(new string('a', builder.Length - 10) + new string('b', 10), builder.ToString());
}

[Fact]
public static void Replace_CharSpan_StringBuilderWithMultipleChunks_WholeString()
{
StringBuilder builder = StringBuilderWithMultipleChunks();
builder.Replace(builder.ToString().AsSpan(), "".AsSpan());
Assert.Same(string.Empty, builder.ToString());
}

[Fact]
public static void Replace_CharSpan_StringBuilderWithMultipleChunks_LongString()
{
StringBuilder builder = StringBuilderWithMultipleChunks();
builder.Replace((builder.ToString() + "b").AsSpan(), "".AsSpan());
Assert.Equal(s_chunkSplitSource, builder.ToString());
}

[Fact]
public static void Replace_CharSpan_Invalid()
{
var builder = new StringBuilder(0, 5);
builder.Append("Hello");

AssertExtensions.Throws<ArgumentException>("oldValue", () => builder.Replace(new char[0].AsSpan(), new char[] { 'a' }.AsSpan())); // Old value is empty
AssertExtensions.Throws<ArgumentException>("oldValue", () => builder.Replace(new char[0].AsSpan(), new char[] { 'a' }.AsSpan(), 0, 0)); // Old value is empty

AssertExtensions.Throws<ArgumentOutOfRangeException>("requiredLength", () => builder.Replace(new char[] { 'o' }.AsSpan(), new char[] { 'o', 'o' }.AsSpan())); // New length > builder.MaxCapacity
AssertExtensions.Throws<ArgumentOutOfRangeException>("requiredLength", () => builder.Replace(new char[] { 'o' }.AsSpan(), new char[] { 'o', 'o' }.AsSpan(), 0, 5)); // New length > builder.MaxCapacity

AssertExtensions.Throws<ArgumentOutOfRangeException>("startIndex", () => builder.Replace(new char[] { 'a' }.AsSpan(), new char[] { 'b' }.AsSpan(), -1, 0)); // Start index < 0
AssertExtensions.Throws<ArgumentOutOfRangeException>("count", () => builder.Replace(new char[] { 'a' }.AsSpan(), new char[] { 'b' }.AsSpan(), 0, -1)); // Count < 0

AssertExtensions.Throws<ArgumentOutOfRangeException>("startIndex", () => builder.Replace(new char[] { 'a' }.AsSpan(), new char[] { 'b' }.AsSpan(), 6, 0)); // Count + start index > builder.Length
AssertExtensions.Throws<ArgumentOutOfRangeException>("count", () => builder.Replace(new char[] { 'a' }.AsSpan(), new char[] { 'b' }.AsSpan(), 5, 1)); // Count + start index > builder.Length
AssertExtensions.Throws<ArgumentOutOfRangeException>("count", () => builder.Replace(new char[] { 'a' }.AsSpan(), new char[] { 'b' }.AsSpan(), 4, 2)); // Count + start index > builder.Length
}
TheMaximum marked this conversation as resolved.
Show resolved Hide resolved

[Theory]
[InlineData("Hello", 0, 5, "Hello")]
[InlineData("Hello", 2, 3, "llo")]
Expand Down
Loading