Ring/Lessons/Check Data Type and Conversion

Check Data Type and Conversion
In this chapter we are going to learn about the functions that can be used for


 * Checking Data Type
 * Checking Character
 * Conversion

Check Data Type
The next functions can be used to check the data type


 * isstring
 * isnumber
 * islist
 * type
 * isnull

IsString Function
Using the IsString function we can know if the value is a string or not

Syntax:

Example:

IsNumber Function
Using the IsNumber function we can know if the value is a number or not

Syntax:

Example:

IsList Function
Using the IsList function we can know if the value is a list or not

Syntax:

Example:

pair: Data Type; Type

Type Function
We can know the type of a value using the Type Function.

Syntax:

Example:

IsNULL Function
We can check the value to know if it's null or not using the IsNULL function

Syntax:

Example:

Check Character
The next functions can be used to check character


 * isalnum
 * isalpha
 * iscntrl
 * isdigit
 * isgraph
 * islower
 * isprint
 * ispunct
 * isspace
 * isupper
 * isxdigit

IsAlNum Function
We can test a character or a string using the IsAlNum Function

Syntax:

Example:

IsAlpha Function
We can test a character or a string using the IsAlpha Function

Syntax:

Example:

IsCntrl Function
We can test a character or a string using the IsCntrl Function

Syntax:

Example:

IsDigit Function
We can test a character or a string using the IsDigit Function

Syntax:

Example:

IsGraph Function
We can test a character or a string using the IsGraph Function

Syntax:

Example:

IsLower Function
We can test a character or a string using the IsLower Function

Syntax:

Example:

IsPrint Function
We can test a character or a string using the IsPrint Function

Syntax:

Example:

IsPunct Function
We can test a character or a string using the IsPunct Function

Syntax:

Example:

IsSpace Function
We can test a character or a string using the IsSpace Function

Syntax:

Example:

IsUpper Function
We can test a character or a string using the IsUpper Function

Syntax:

Example:

IsXdigit Function
We can test a character or a string using the IsXdigit Function

Syntax:

Example:

Conversion
The next functions can be used for conversion


 * number
 * string
 * ascii
 * char
 * hex
 * dec
 * str2hex
 * hex2str

Number Function
We can convert strings to numbers using the Number function or the + operator.

Syntax:

Example:

String Function
We can convert numbers to strings using the String function or the + operator.

Syntax:

Example:

Ascii Function
We can get the ASCII code for a letter using the Ascii function

Syntax:

Example:

Char Function
We can convert the ASCII code to character using the Char function.

Syntax:

Example:

Hex Function
We can convert decimal to hexadecimal using the Hex function.

Syntax:

Example:

Dec Function
We can convert hexadecimal to decimal using the Dec function

Syntax:

Example:

Str2hex Function
We can convert string characters to hexadecimal characters using the Str2hex function.

Syntax:

Example:

Hex2str Function
We can convert hexadecimal characters to string using the Hex2str function

Syntax:

Example: