-
Notifications
You must be signed in to change notification settings - Fork 7
Add string utility functions: trimStart, trimEnd, trim #74
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds three new string utility functions for trimming specific substrings from strings: ltrim (left trim), rtrim (right trim), and trim (both sides). These functions extend the existing string utilities by allowing removal of custom needle strings rather than just whitespace.
- Added
ltrim,rtrim, andtrimfunctions to handle custom substring trimming - Comprehensive test coverage for all three functions including edge cases
- Updated CHANGELOG.md to document the new functionality
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lib/string.ts | Implements the three new trim functions with proper null/undefined handling |
| src/lib/string.spec.ts | Adds comprehensive test cases covering normal usage and edge cases |
| CHANGELOG.md | Documents the addition of the new string utility functions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
commit: |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…im to trimEnd and improved the code
|
@drebrez THe PR is fine for me, I will let you double check and merge it if it's fine :) |
|
Add features ltrim, rtrim and trim for issue #29