WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Change order of array, johan, September 30, 2003
     Re:Change order of array, Erik Arvidsson, October 1, 2003
     Re:Change order of array, Wellington, September 30, 2003
         Re:Change order of array, johan, October 1, 2003
             Re:Change order of array, Wellington, October 1, 2003

Subject: Re:Change order of array From: johan Date: October 1, 2003

not exactly what i wanted...your example only changes 1st and 5th value but not the other ones, like:

array[]="1abcd" to array[]="dabc1"

or?

From: Wellington
Sent: September 30, 2003
Subject: Re:Change order of array

if array[] is an array:
  aux = array[array.length]
  array[array.length] = array[0]
  array[0] = aux;

but if it is a String, what seems,
   str = str[str.length - 1] + str.substr(1, str.length - 1) + str[0];

From: johan
Sent: September 30, 2003
Subject: Re:Change order of array

hi, i want to move the last value of an array to the 1st position:

array[]="abcd1"   to   array[]="1abcd"

How can i do this in a fast way? Only change one value. Do i have to change all the values in the array?






Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX