This type represents a Perl array.
|
The following example gets a wrapper around the array named "@array" in the Perl interpreter's context. It then adds some values into the array and displays its contents using Eval.
| C# Example |
Interpreter perl = new Interpreter();
Array a = perl.GetArray("array");
for (int i = 0; i < 3; i++) {
a.Add((double)i/4);
Console.WriteLine("The Array Has: {0}", perl.Eval("join(', ', @array)"));
}
|
See Also: Inherited members from Value.
|
Array(Interpreter) Creates a new, empty array in the given context. |
|
Array(Interpreter, Value[]
) Creates a new array in the given context containing the given array of values. |
|
Array(Interpreter, object[]
) Creates a new array in the given context containing the given array of values. |
|
Count
[read-only]
|
int. Returns the number of elements in the array. |
|
Item[int] |
Value. Returns an element in the array. |
|
Add(object) Pushes the object onto the array.
|
|
|
AddRange(ICollection) Pushes the elements of a collection onto the array.
|
|
|
Clear() Clears the contents of the Array.
|
|
|
Contains(Value) Returns whether the array contains the value.
|
|
|
Contains(object) Returns whether the array contains the object.
|
|
|
Delete(int) Removes the first instance of an item from within the array.
|
|
|
IndexOf(Value) Returns the first index of the value in the array, or -1 if it is not in the array.
|
|
|
IndexOf(object) Returns the first index of the object in the array, or -1 if it is not in the array.
|
|
|
IsSet(int) Tests whether an element is defined (versus undef).
|
|
|
Pop() Pops the last Value off the end of the Array.
|
|
|
Push(Value) Pushes a value onto the end of the Array.
|
|
|
Remove(object) Removes the first instance of an object from the array.
|
|
|
SetSize(int) Ensures that the array has a given number of elements.
|
|
|
Shift() Removes the first item from the array and shifts the array down.
|
|
|
Unshift(int) Shifts the elements of the Array down, making room at the start of the Array.
|
|
|
Unshift(Value) Pushes a Value into the start of the array.
|
|
|
Unshift(Value[]
) Pushes Values into the start of the array.
|
Creates a new, empty array in the given context.
Creates a new array in the given context containing the given array of values.
Creates a new array in the given context containing the given array of values.
Clears the contents of the Array.
Removes the first instance of an item from within the array.
Tests whether an element is defined (versus undef).
Ensures that the array has a given number of elements.
Pops the last Value off the end of the Array.
Pushes a value onto the end of the Array.
Removes the first item from the array and shifts the array down.
Shifts the elements of the Array down, making room at the start of the Array.
Pushes a Value into the start of the array.
Pushes Values into the start of the array.
Returns whether the array contains the value.
Returns the first index of the value in the array, or -1 if it is not in the array.
Pushes the object onto the array.
Pushes the elements of a collection onto the array.
Returns whether the array contains the object.
Returns the first index of the object in the array, or -1 if it is not in the array.
Removes the first instance of an object from the array.
Returns the number of elements in the array.
Returns an element in the array.