Free Code Snippets in C#, Net Framework, Office 365, ASP.Net,WPF, Visual Studio, SQL Server, Antivirus free
#

 

 

Compare string in Java to empty string ""

 

In Java, the comparison can be made to an empty string or null not with string == "".

Instead you have to use string.isEmpty () == true

 

Correct

if(string_Test.isEmpty()==true) {
   
_db.add_Note(sText, dtInput);
}

 

Correct

if(string_Test!="") {
   
_db.add_Note(sText, dtInput);
}

 

Mobile
»
Android Java: Create unique GUID at runtime
»
Android Java: Comparison with empty string
»
Android java: Code area // region - // endregion
»
Android: Create a color picker
»
Android: View items by name or tag or id
»
Android Java: Create a view event at runtime and assign it to a view element
»
Android Java: Create view button at runtime
»
Android Java: create a view element as a float
»
Input field in Android
»
Android Java: compare date day

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de