-
Notifications
You must be signed in to change notification settings - Fork 465
feat: add a parameter named autoStrip #567
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 a new autoStrip parameter with a default value of false to complement the existing autoTrim functionality. The feature provides automatic whitespace stripping for both sheet names and cell content, supporting a broader range of whitespace characters compared to standard trim operations.
- Add
StringUtils.strip()andStringUtils.isBlankChar()methods for enhanced whitespace handling - Integrate
autoStripparameter throughout the codebase (readers, writers, and configuration) - Update sheet name matching logic to support stripping of whitespace characters
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
StringUtils.java |
Adds strip() method and isBlankChar() helper for extended whitespace detection |
StringUtilsTest.java |
Comprehensive tests for the new strip functionality |
AutoStripParameterTest.java |
Integration tests covering autoStrip behavior across Excel formats |
ParameterUtil.java |
Utility methods for determining autoTrim/autoStrip flags in read/write contexts |
GlobalConfiguration.java |
Adds autoStrip configuration with default false value |
| Multiple handlers | Updates cell data processing to apply strip logic when autoStrip is enabled |
| CSV builders | Integrates autoStrip with CSV trim behavior |
SheetUtils.java |
Updates sheet name matching to support autoStrip functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
fastexcel/src/test/java/cn/idev/excel/util/StringUtilsTest.java
Outdated
Show resolved
Hide resolved
fastexcel/src/main/java/cn/idev/excel/analysis/csv/CsvExcelReadExecutor.java
Outdated
Show resolved
Hide resolved
psxjoy
left a comment
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.
LGTM
Purpose of the pull request
Close #421
What's changed?
stripandisBlankCharmethods for whitespace handling in theStringUtils.autoStripwith a default value offalse.BTW, we may upgrade to a higher JDK version in the future. At that time, we will only need to modify the
StringUtils#stripmethod , such as replacing it withjava.lang.String#strip.Checklist