Skip to content

fix: capitalization logic#11

Merged
Chinmay-KB merged 1 commit intomasterfrom
fix/capitalize-normalization
Mar 21, 2026
Merged

fix: capitalization logic#11
Chinmay-KB merged 1 commit intomasterfrom
fix/capitalize-normalization

Conversation

@Chinmay-KB
Copy link
Copy Markdown
Owner

This pull request focuses on improving the string capitalization logic in the stringr package, making the capitalize method more robust and consistent, especially for strings that are already in uppercase or have mixed casing. It also updates the version and adds relevant test cases to ensure the new behavior works as intended. Fixes #9

Enhancements to string capitalization:

  • Improved the capitalize method in case.dart so that if the first character is already uppercase, the rest of the string is converted to lowercase, ensuring consistent capitalization for strings like "HELLO" or "HeLLo".
  • Updated the logic in the case extension to handle words that are fully uppercase, preserving them as-is when appropriate.

Testing improvements:

  • Added new test cases in case_test.dart to verify the updated capitalize behavior for all-uppercase and mixed-case strings.

Version update:

  • Bumped the package version from 1.2.1 to 1.2.2 in pubspec.yaml to reflect these changes.

@Chinmay-KB Chinmay-KB merged commit af60b82 into master Mar 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

capitalize() keeps full uppercase strings instead of normalizing case

1 participant