yangxu998 / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Strings.isNullOrEmpty enhancement #652

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Today I looked at the code of Strings.isNullOrEmpty and was really surprised to 
find out that it does not trim the string before checking its size/emptiness. 
Can this method be changed or some other method be added that would also call 
trim() on String before checking its size?

TIA

P.S. calling trim() on String before passing it to isNullOrEmpty won't work, 
since it can throw NPE if the passed String is null.

Original issue reported on code.google.com by elchin.a...@gmail.com on 7 Jul 2011 at 1:52

GoogleCodeExporter commented 9 years ago
name suggestion: Strings.isNullOrBlank

Original comment by elchin.a...@gmail.com on 7 Jul 2011 at 1:57

GoogleCodeExporter commented 9 years ago

Original comment by kurt.kluever on 7 Jul 2011 at 2:46

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:15

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:09