a
, T
v
,
int
star t
)
Returns the index of the last element within a range of the one-dimensional
array
a
that has the value specified by
v.
The search proceeds in reverse
order, beginning at
a
[
star t
] and stopping at
a
[0]. Returns –1 if the value is
not found.
public static int LastIndexOf(Array
a
, object
v
,
int
star t
, int
count
)
Returns the index of the last element within a range of the one-dimensional
array
a
that has the value specified by
v.
The search proceeds in reverse order,
beginning at
a
[
start
] and running for
count
elements. Returns –1 if the value is
not found within the specified range. (If the array has a lower bound other than
0, then the failure value is the lower bound –1.)
public static int LastIndexOf(T[ ]
a
, T
v
,
int
star t
,
int
count
)
Returns the index of the last element within a range of the one-dimensional
array
a
that has the value specified by
v.
The search proceeds in reverse
order, beginning at
a
[
star t
] and running for
count
elements. Returns –1 if the
value is not found within the specified range.
public static void Resize(ref T[ ]
a
, int
size
)
Sets the size of
a
to
size.
public static void Reverse(Array
a
)
Reverses the elements in
a.
public static void Reverse(Array
a
, int
star t
,
int
count
)
Reverses a range of elements in
a.
The range reversed begins at
a
[
star t
] and
runs for
count
elements.
public void SetValue(object
v
, int
idx
)
Sets the value of the element at index
idx
within the invoking array to
v.
The
array must be one-dimensional.
public void SetValue(object
v
, long
idx
)
Sets the value of the element at index
idx
within the invoking array to
v.
The
array must be one-dimensional.
public void SetValue(object
v
, int
idx1
, int
idx2
)
Sets the value of the element at indices [
idx1
,
idx2
] within the invoking array
to
v.
The array must be two-dimensional.
public void SetValue(object
v
,
long
idx1
, long
idx2
)
Sets the value of the element at indices [
idx1
,
idx2
] within the invoking array
to
v.
The array must be two-dimensional.
public void SetValue(object
v
, int
idx1
,
int
idx2
, int
idx3
)
Sets the value of the element at indices [
idx1
,
idx2
,
idx3
] within the invoking
array to
v.
The array must be three-dimensional.
public void SetValue(object
v
, long
idx1
,
long
idx2
, long
idx3
)
Sets the value of the element at indices [
idx1
,
idx2
,
idx3
] within the invoking
array to
v.
The array must be three-dimensional.
public void SetValue(object
v
, int[ ]
idxs
)
Sets the value of the element at the specified indices within the invoking array
to
v.
The array must have as many dimensions as
idxs
has elements.
public void SetValue(object
v
, long[ ]
idxs
)
Sets the value of the element at the specified indices within the invoking array
to
v.
The array must have as many dimensions as
idxs
has elements.
public static void Sor t(Array
a
)
Sor ts
a
into ascending order. The array must be one-dimensional.
public static void Sor t(T[ ]
a
)
Sor ts
a
into ascending order. The array must be one-dimensional.
public static void Sor t(Array
a
,
IComparer
comp
)
Sor ts
a
into ascending order using the comparison method specified by
comp.
The array must be one-dimensional.
public static void Sor t(T[ ]
a
,
Comparison
comp
)
Sor ts
a
into ascending order using the comparison method specified by
comp.
The array must be one-dimensional.
public static void Sor t(T[ ]
a
,
IComparer
comp
)
Sor ts
a
into ascending order using the comparison method specified by
comp.
The array must be one-dimensional.
public static void Sor t(Array
k
, Array
v
)
Sor ts a pair of one-dimensional arrays into ascending order. The
k
array
contains the sor t keys. The
v
array contains the values linked to those keys.
Thus, the two arrays contain key/value pairs. After the sor t, both arrays are
in ascending-key order.
T
ABLE
21-12
Methods Defi ned by
Array
(continued)
Method
Meaning
www.freepdf-books.com
Do'stlaringiz bilan baham: |