REBOL Document

Empty? - Function Summary


Summary:

Returns TRUE if a series is at its tail.

Usage:

empty? series

Arguments:

series - The series argument. (must be: series port bitset)

Description:

This is a synonym for TAIL? The check is made relative to the current location in the series.


 print empty? []
 true


 print empty? [1]
 false

The EMPTY? function is useful for all types of series. For instance, you can use it to check a string returned from the user:


 str: ask "Enter name:"
 if empty? str [print "Name is required"]
 Enter name:

It is often used in conjunction with TRIM to remove black spaces from the ends of a string before checking it:


 if empty? trim str [print "Name is required"]

Related:

found? - Returns TRUE if value is not NONE.
none? - Returns TRUE for none values.
tail? - Returns TRUE if a series is at its tail.

AltStyle によって変換されたページ (->オリジナル) /