Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I delete a range from an array

Status
Not open for further replies.

Tve

Programmer
May 22, 2000
166
FR
I have an array @Foo with indices from 0 to 200.
How do I delete indices 0 to 30. Do I have to build a loop?

Delete() only seems only to work for hashes...
Pop() only deletes the last row....

A syntax like: delete(@Foo,0,30) seems nice, but I cannot find it.

Thanks,

Thierry [sig][/sig]
 
Why dont you use the shift function inside a loop like this?

for ($i=1; $i<=30; $i++) {
shift (@Foo);
}
 
Damann,

Thanks for you solution....

Ik the whenwhile, I have found another solution:

@Foo= splice(@Foo,0,30);

Thanks for the effort.

Thierry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top