Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

check if a string is empty java

if (myString == null || myString.equals(""))
			throw new IllegalArgumentException("empty string");
Comment

check if string is empty

let str1 = "Hello world!";
let str2 = "";
let str3 = 4;
console.log(str1.length === 0)
console.log(str2.length === 0)
console.log(str3.length === 0)

false
true
false
Comment

PREVIOUS NEXT
Code Example
Javascript :: angular material dropdown menu 
Javascript :: ternary operator jquery 
Javascript :: javascript es6 find 
Javascript :: angular get name of component 
Javascript :: sum index of an array javascript 
Javascript :: context hook 
Javascript :: Find the index of an item in the Array 
Javascript :: vue js count down timer 
Javascript :: nestjs set swagger api keys 
Javascript :: react router remove location state on refresh 
Javascript :: unzip file electronjs 
Javascript :: javascript check if element has specific child 
Javascript :: tailwind css toggle switch react 
Javascript :: select parent of elemt 
Javascript :: get current location city name react native 
Javascript :: js clearect 
Javascript :: javascript change select element 
Javascript :: change color react icon 
Javascript :: animate javascript 
Javascript :: path module js 
Javascript :: how to validate from and to date using date.parse in javascript 
Javascript :: jquery add class except this 
Javascript :: javascript add update query parameter to url 
Javascript :: js sort by two numeric fields 
Javascript :: javascript html video seek to time 
Javascript :: clone element 
Javascript :: catch errors async await javascript 
Javascript :: how to make button in react js 
Javascript :: svg css viewbox 
Javascript :: react leaflet disable zoom 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =