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

Two helper methods #377

Merged
merged 1 commit into from
Feb 8, 2013

Conversation

recurve
Copy link
Contributor

@recurve recurve commented Feb 8, 2013

These two helper methods are in some other open source libraries but we don't always include those. It bugged me enough that I added them here.

Signed-off-by: Aaron Rosenzweig [email protected]

These two helper methods are in some other open source libraries but we don't always include those. It bugged me enough that I added them here.

Signed-off-by: Aaron Rosenzweig <[email protected]>
pascalrobert pushed a commit that referenced this pull request Feb 8, 2013
@pascalrobert pascalrobert merged commit fc67e8f into wocommunity:integration Feb 8, 2013
@paulhoadley
Copy link
Contributor

Hang on... Aaron, does this differ significantly from stringIsNullOrEmpty()? If so, I don't see it, other than providing the converse method in the same patch.

@recurve
Copy link
Contributor Author

recurve commented Feb 8, 2013

Hi Paul. If you feel strongly you can revert these changes, I don't feel that passionate that they have to be here. But to answer your question there is a difference between "empty" and "blank". The "stringIsNullOrEmpty()" does not trim a string. The two methods "isBlank" and "isNotBlank" are easier to read and use but of course, that is just opinion.

@paulhoadley
Copy link
Contributor

Thanks for pointing out the use of trim(), Aaron, I didn't notice that. I still worry about the proliferation of subtly-different methods in these kitchen-sink utility classes. I completely agree with Kieran in that we should encourage the use of, say, Commons Lang rather than be continually reinventing wheels. I've got nothing against Aaron's methods in particular, but this is just a good example of a wider problem. @pascalrobert, you merged the request—comments?

@pascalrobert
Copy link
Contributor

I must admit that I didn't check if similar methods already existed. And yes, we should use the Apache Commons stuff wherever we can.

@paulhoadley
Copy link
Contributor

Well, I've got nothing against Aaron, or his methods in particular, nor should this comment be taken to mean that I think that ERXStringUtilities is otherwise perfect, but... I think this commit should be reverted.

@ishimoto
Copy link
Contributor

Sorry to see this is closed. I hand't a time to look but "isBlank" and "isNotBlank" isn't bad.
But it is not perfect, it would be nice to implement it but also not only with a English Space trim. Also a Chinese, Korean or Japanese space trim. I know you maybe ????
But we have one more Space Char in CKJ, and that would help people writing this kind of Apps.

@recurve
Copy link
Contributor Author

recurve commented Feb 11, 2013

Hey Ken! That I would like very much. I wasn't aware that "trim()" doesn't account for some unicode whitespace.

@ishimoto
Copy link
Contributor

There are a lot of problems, I will make an presentation about what can happen at WOWODC

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.

7 participants