Fix equality check between sb1 and sb2#12274
Merged
Merged
Conversation
Corrected the comparison result of sb1 and sb2 to reflect that they are equal.
gewarren
reviewed
Feb 24, 2026
gewarren
left a comment
Collaborator
There was a problem hiding this comment.
Thank you @mahfeshar, sorry for the delay in reviewing. Can you also please update cap.vb and cap.fs?
Contributor
Author
|
Thanks for the review! No problem at all regarding the delay. |
Contributor
Author
@dotnet-policy-service agree |
gewarren
approved these changes
Feb 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR/Issue corrects outdated information in the StringBuilder.Equals(StringBuilder) documentation to align it with modern .NET behavior (starting from .NET Core 3.0 through .NET 10).
Key Changes:
Updated section: Removed references to Capacity and MaxCapacity equality, as these properties are no longer part of the comparison logic in modern .NET versions.
Corrected Example Output: Updated the sample code's expected output for case b4. Previously, the example incorrectly stated that sb1.Equals(sb2) would return False when capacities differed. In modern .NET, this returns True as it performs an ordinal string comparison.
Consistency: Resolved the contradiction between the "Remarks" section (which correctly described the .NET Core 3.0+ behavior) and the "Returns/Example" sections which were still reflecting the legacy .NET Framework behavior.