describe

Prev Next

Function Names

describe

Description

This function describes the string or value provided and returns one of the following results:

identified description Explanation
integer Contains a simple integer, positive or negative.
numeric Contains a number with digits specified behind, even if they are zero
scientific Contains a number with scientific notation
character Contains one non-numeric and visible character (excluding white space characters. See 'white' below, but non-breaking spaces (UNICODE 160 / U+00AF0) are not)
word Contains visible character containing letters, but no space in-between.
line One line containing multiple words
paragraph Contains multiple lines (at least 1 new line symbol inside, but not before or after the contents)
date Contains a date, comprising of day, month and year in an unambiguous format. Birthday dates without years are not considered as dates.
time Contains a time in an unambiguous format, at least hour and minute, optionally second
date time Contains both full date and time as specified above
blank Empty contents (zero characters)
white Contains white spaces only (e.g. space, tabs, new lines)

For all cases listed above, except for 'blank' and 'white', white spaces before the beginning of the contents and after the end of the contents will be ignored, including new line.

This function creates a string containing random upper-case characters from A..Z and digits 0..9. The function random letters generates strings with upper-case characters from A..Z only.

Vectorization: This function supports vectorization in the 1st function parameter. Instead of providing a single value, you can provide a set or even a nested set which contain multiple values. The function will then process every value and its return value contains a corresponding set containing all results.

Call as: function

Restrictions

Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter

Parameter count

1

Parameters

No.TypeDescription
1
input
string
set
Contents

This string contains entities to be encoded. Vectorization can be used to provide multiple strings in a (nested) set.

Return value

TypeDescription
string
set
Identified description(s)

If vectorization is enabled, then a set containing the results is provided.

Examples

       strings[] = { "", "  ", "13", " 12.1", "1E+3", " C", "Hello", "Hello World", "Hello" + new line + "World",
              "20. April 2021 13:15", "2021-04-20", "13:15:00" };

       for all( strings[], string[] ) echo( string[], " --> ", describe(string[]), new line);
       echo( describe( { a, abc, 1.3.2021 } ) ); // Exmaple with vectorization

Output

 --> blank

   --> white

13 --> integer

12.1 --> numeric

1E+3 --> scientific

C --> character

Hello --> word

Hello World --> line

Hello
World --> paragraph

20. April 2021 13:15 --> date time

2021-04-20 --> date

13:15:00 --> time

{'character','word','date'}
Try it yourself: Open LIB_Function_describe.b4p in B4P_Examples.zip. Decompress before use.

See also

table describe
date inside
is numeric
is integer
date inside
time inside