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>
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.