Conversation
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
SubstringAfterLast
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #62 +/- ##
=======================================
Coverage 84.46% 84.46%
=======================================
Files 23 23
Lines 721 721
Branches 85 85
=======================================
Hits 609 609
Misses 58 58
Partials 54 54 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request refactors the SubstringAfterLast method in StringExtensions.cs to use modern C# range indexer syntax for improved code consistency and readability. The change replaces verbose Substring(startIndex, length) arithmetic with the cleaner range indexer syntax str[(index + sub.Length)..], aligning with the existing implementation patterns of SubstringUntil and SubstringUntilLast in the same file.
Changes:
- Simplified string slicing in
SubstringAfterLastby replacingSubstringmethod call with range indexer syntax
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot fix formatting |
Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Updated [GitHubActionsTestLogger](https://github.com/Tyrrrz/GitHubActionsTestLogger) from 3.0.1 to 3.0.2. <details> <summary>Release notes</summary> _Sourced from [GitHubActionsTestLogger's releases](https://github.com/Tyrrrz/GitHubActionsTestLogger/releases)._ ## 3.0.2 ## What's Changed * Bump the nuget group with 4 updates by @dependabot[bot] in Tyrrrz/GitHubActionsTestLogger#59 * Bump the nuget group with 1 update by @dependabot[bot] in Tyrrrz/GitHubActionsTestLogger#60 * Migrate to Centralized NuGet Package Management (CPM) by @Copilot in Tyrrrz/GitHubActionsTestLogger#61 * Use range indexer in `SubstringAfterLast` by @Copilot in Tyrrrz/GitHubActionsTestLogger#62 * Bump the nuget group with 7 updates by @dependabot[bot] in Tyrrrz/GitHubActionsTestLogger#63 * Fix build errors from obsolete MTP API usage by @Copilot in Tyrrrz/GitHubActionsTestLogger#64 * Remove explicit Microsoft.SourceLink.GitHub package reference by @Copilot in Tyrrrz/GitHubActionsTestLogger#65 * Add strong naming by @mgravell in Tyrrrz/GitHubActionsTestLogger#67 ## New Contributors * @Copilot made their first contribution in Tyrrrz/GitHubActionsTestLogger#61 * @mgravell made their first contribution in Tyrrrz/GitHubActionsTestLogger#67 **Full Changelog**: Tyrrrz/GitHubActionsTestLogger@3.0.1...3.0.2 Commits viewable in [compare view](Tyrrrz/GitHubActionsTestLogger@3.0.1...3.0.2). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
str.Substring(index + sub.Length, str.Length - index - sub.Length)withstr[(index + sub.Length)..]inSubstringAfterLastSubstringUntilandSubstringUntilLastOriginal prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.