isempty

isempty(collection) -> Bool

Determine whether a collection is empty (has no elements).

julia> isempty([])
true

julia> isempty([1 2 3])
false

Examples

julia> isempty([])
true
julia> isempty([1,2,2])
false

julia> isempty([])
true
julia> isempty([1,2,3])
false
  1. Check if an array is empty:

    julia> isempty([])
    true

    This example checks if the array is empty.

  2. Check if a string is empty:

    julia> isempty("")
    true

    It determines if the string is empty.

  3. Check if a dictionary is empty:
    julia> dict = Dict("a" => 1, "b" => 2);
    julia> isempty(dict)
    false

    It determines if the dictionary is empty.

See Also

append!, delete!, deleteat!, empty!, endof, filter, filter!, gc, get!, getkey, haskey, insert!, isempty, keys, map, map!, merge, merge!, pop!, prepend!, push!, reduce, resize!, shift!, splice!, unshift!, values,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: