Questions tagged [is-empty]

Questions about items that can be described as empty or having no data value

776 questions
-2
votes
3 answers

Trying to check if int[] is empty Java

Simple, I am trying to check if int[] distances is empty or not. Why does this not work? My Code: int[] distances = {3,6,7,6,1,8,8,2,3,4,5,9}; if(distances != null && !distances.isEmpty()) { throw new TransportException("No routes in…
user2863323
  • 345
  • 2
  • 3
  • 13
-3
votes
1 answer

Java LinkedList being empty is not the same as being equal to null?

Hello, I am trying to implement a Least Significant Digit Radix Sort using Java. On line 130 I create the array of Linked Lists that will hold the sorted integers and initialize each element to an empty linked List on line 133. Everything works…
-3
votes
2 answers

PHP—Does array evaluate to empty after removing last element?

I am removing an element from an array in PHP: $images = array('img1.jpg', 'img2.jpg', 'img3.jpg', 'no-image.jpg'); if (in_array('no-image.jpg', $images)) { $imgIndex = array_search('no-image.jpg', $images); array_splice($images, $imgIndex,…
ajarrow
  • 414
  • 2
  • 10
-3
votes
4 answers

check string is null or empty - logic

In continuation of this post (Check String is NULL or EMPTY), I managed to successfully write up the if and else logic. However, my third logic does not work. My third logic is something like checking both empty fields at the same time and if they…
user10504780
-3
votes
2 answers

How To Check 5 Empty Variables in PHP

I need to make a conditional statement where the 5 variables should be empty before perform an action. The problem is some variables can be zero, false or NULL value. How to catch all of them? Which one is better? If (!$a && !$b && !$c && !$d &&…
Drunken M
  • 2,013
  • 2
  • 11
  • 18
-3
votes
2 answers

How to discriminate between null and zero length string in .NET?

What is the most efficient way to discriminate between empty and null value? I want to: evaluate CStr(str) to True when str="", whereas evaluate CStr(str) to False when str=Nothing
anefeletos
  • 672
  • 7
  • 19
-3
votes
2 answers

How to check a Float variable is empty or null IN JAVA

I have a Float variable which is initialised from a function returning the Float value, and there can be chance to return null in some cases. So I need to check the value in the variable is null or empty. If the value is empty I need to initialise…
Senchu Thomas
  • 518
  • 3
  • 9
  • 24
-3
votes
2 answers

which way is correct way of checking not null variable

Which is the more effective way of checking whether $value is not null if ($value > 0 && $value !== 'null') { } or if (empty($value)) { }
black999
  • 11
  • 1
-4
votes
3 answers

C Get size of Array of array of chars

i want to get the number of elements at Text array the answer should be 2 char Text[5][10] = { "Big12345", "Big54321", }; i want to a code to count number of elements in array of chars
-5
votes
1 answer

How to check if an Arraylist index is empty

I have a question asking to read indexes and check if its empty and if it is and its at a position greater than or equal to 67(starting from 0), I must print out the element located at index i-67. The problem I'm having I believe is checking if an…
Tdlk
  • 1
  • 1
  • 2
1 2 3
51
52