View Single Post
  #14 (permalink)  
Old 05-27-2008, 01:33 AM
Jeyaseelansarc Jeyaseelansarc is offline
D-Web Genius
 
Join Date: Mar 2007
Location: Chennai
Posts: 1,162
Jeyaseelansarc is on a distinguished road
Send a message via AIM to Jeyaseelansarc
Default Re: Manipulating in array

splice() - It is used to take elements out of an array and replace them with those specified. In the below example the element starting at element 3 is removed, two of them are removed and replaced with the specified strings. The value returned are those values that are replaced. This method is not defined so it must be written and included in your code.
Code:
words = new Array("limit","lines","finish","complete","In","Out")
words1 = words.splice(3, 2, "done", "On")
The value of words becomes:

limit, lines, finish, done, On, Out

The value of words1 is set to:

complete, In
__________________
With,
J. Jeyaseelan

Everything Possible
Reply With Quote