ARRAY
ARRAY
is a data type used to represent a value composed of a sequence of elements of the same type. This data type can store a series of elements with the same data type, making it convenient for unified management and operation.
Syntax
elementType
:Specifies the data type of the elements in the array.
ARRAY constant format
This format represents an array constant. Please ensure that when defining an array constant, do not use quotes, as quotes will cause it to be recognized as a string type, and the string type '[1,3,4]'
cannot be directly cast into the array<int>
type.
Example
- Create an integer array:
- Convert an integer array to a string array:
- Get the data type of array elements:
- Create a nested array (an array containing other arrays):
- Get specific elements in an array:
- Use the
IN
operator to check if a specific element exists in an array: - Sorting an array:
- Merge Two Arrays: