Skip to content
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

LANG-1682 Adding StringUtils.startsWithAnyIgnoreCase method #848

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Enigo
Copy link
Contributor

@Enigo Enigo commented Jan 18, 2022

Adding StringUtils.startsWithAnyIgnoreCase to have more flexibility.
Based on the existing startsWith method

@LarsBodewig
Copy link

Concurrent open PR for LANG-1682: #852

@Enigo
Copy link
Contributor Author

Enigo commented Dec 23, 2022

Hey @garydgregory
any chance for this PR to be reviewed and merged?
thanks!

@garydgregory
Copy link
Member

Needs further thought: I don't think it makes sense to overcrowd this class with more "ignore case" versions of methods and to also have "any" or "all" versions of methods. Instead, we should consider another design, maybe having a string util class with a subclass for case sensitive and another for cases insensitive matches, for example.

@Enigo
Copy link
Contributor Author

Enigo commented Dec 23, 2022

I'm not sure if that would be user-friendly, as most users are used to one single class for all operations with strings, numbers, lists, sets etc.
That would be quite a drastic change
But I do agree that this class is quite crowded already

* StringUtils.startsWithAny("abcxyz", new String[] {null, "xyz", "abc"}) = true
* StringUtils.startsWithAny("abcxyz", null, "xyz", "ABCX") = true
* StringUtils.startsWithAny("ABCXYZ", null, "xyz", "abc") = true
* </pre>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this class is getting cluttered.
However if the method is added, at least the Javadoc examples should have the correct method name

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.

4 participants