This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

StringUtils.isEmpty  RSS feed

 
Premila Devi Dayalan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

Please define the meaning of ,are they define as
checks if a String contains text


Sample Code:
(!StringUtils.isEmpty(asset.getSerialNumber()))
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16006
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that the class StringUtils is not a class from the standard Java API. It's probably a class from some library, or even defined in your own software.

Most likely it checks if the string that you pass in is null or "". It's just a convenience method, so that you don't have to write code like this all the time:

 
Premila Devi Dayalan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Noted.Thanks a lots.
 
Rob Spoor
Sheriff
Posts: 21044
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Empty may or may not also mean that a String only contains whitespace. If you're talking about Apache Commons Lang then they have a separate method for that, StringUtils.isBlank.
 
Premila Devi Dayalan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
True,Agree with you :Empty may or may not also mean that a String only contains whitespace. If you're talking about Apache Commons Lang then they have a separate method for that, StringUtils.isBlank.

Noted with thanks.
 
Premila Devi Dayalan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dear All,

I like to know what "messageBundle = new MessageBundle();" maintainly do in JSP.

I am confuse on the phrase of "bundle" as the code list above.

Chan Mei Ling

 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16006
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseOneThreadPerQuestion, don't append a new and unrelated question to an old, existing forum topic.
 
Premila Devi Dayalan
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so sorry.
chan mei ling
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!