Skip to content

Conversation

@BillWagner
Copy link
Member

@BillWagner BillWagner commented Feb 10, 2025

Commit by commit history:

  1. Move and update sample code.
  2. Update equality operators to enhance the description of delegate equality. This needs to ensure that the receiver instances are the same object if the target method is an instance method.
  3. Compare == with is for equality comparisons with constants.
  4. Add more overload examples and a summary to the String.Split article.
  5. Final edit pass.

Internal previews

📄 File 🔗 Preview link
docs/csharp/how-to/compare-strings.md How to compare strings in C#
docs/csharp/how-to/concatenate-multiple-strings.md How to concatenate multiple strings (C# Guide)
docs/csharp/how-to/modify-string-contents.md "How to modify string contents"
docs/csharp/how-to/parse-strings-using-split.md How to separate strings using String.Split in C#
docs/csharp/how-to/search-strings.md docs/csharp/how-to/search-strings
docs/csharp/language-reference/operators/equality-operators.md Equality operators - test if two objects are equal or not
docs/csharp/language-reference/operators/is.md "The is operator - Match an expression against a type or constant pattern"
docs/csharp/language-reference/operators/patterns.md Pattern matching - the is and switch expressions, and operators and, or, and not in patterns

@dotnetrepoman dotnetrepoman bot added this to the February 2025 milestone Feb 10, 2025
@dotnet-policy-service dotnet-policy-service bot added okr-freshness OKR: Freshness of content okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings. dotnet-csharp/svc fundamentals/subsvc labels Feb 10, 2025
@BillWagner BillWagner force-pushed the string-split-overloads branch from a9ec691 to c323684 Compare February 10, 2025 18:11
@BillWagner BillWagner force-pushed the string-split-overloads branch 2 times, most recently from e910fa2 to 734e76f Compare February 14, 2025 22:33
Add an example that checks equality of instance delegates to point out that the receivers must be the same for those methods.
To fix dotnet#42548, create links between the equality operator and the pattern matching `is` expression, in the case where the right operand is a constant.

In addition, add notes in the "How to compare strings" article to bring these together.
@BillWagner BillWagner force-pushed the string-split-overloads branch from 734e76f to ca92690 Compare February 18, 2025 16:32
Fixes dotnet#20123  Add additional overloads as necessary, and explain the settings that can be applied among the different overloads.
@BillWagner BillWagner marked this pull request as ready for review February 18, 2025 19:11
@BillWagner BillWagner requested review from a team and IEvangelist as code owners February 18, 2025 19:11
@BillWagner BillWagner force-pushed the string-split-overloads branch from aaecc6c to e32ecc7 Compare February 18, 2025 19:28
@BillWagner BillWagner requested a review from CamSoper February 18, 2025 19:28
Copy link

@CamSoper CamSoper left a comment

Choose a reason for hiding this comment

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

LGTM. Approving with a couple comments.

@BillWagner BillWagner enabled auto-merge (squash) February 18, 2025 20:05
@BillWagner BillWagner merged commit 8626d2d into dotnet:main Feb 18, 2025
8 checks passed
@BillWagner BillWagner deleted the string-split-overloads branch February 18, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dotnet-csharp/svc fundamentals/subsvc lang-reference/subsvc okr-freshness OKR: Freshness of content okr-quality Content-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Projects

None yet

2 participants