Kvang
07-24-2003, 01:09 AM
For example this is a string -> "ABCDE..."
How can you get the characters that are at even posistion for exmple again I wanted to get only the even position character like "A", "C", "E" only in the string "ABCDE...".
Also I wanted to get the character at position for example again once if I got the character A on the 0 position and wanted to skip the other 2 characters and go directly for the other character in the third position like "D" and I wanted to skip both "B" and "C" character. Because I try the for loop to try to do that ,but it doesn't work because if I put in for(var i=0;i<this.length;i+=2)
{
nstring+=this string.charAt(i);
}
And I get AABBC... as a result.
Thanks for your help.
How can you get the characters that are at even posistion for exmple again I wanted to get only the even position character like "A", "C", "E" only in the string "ABCDE...".
Also I wanted to get the character at position for example again once if I got the character A on the 0 position and wanted to skip the other 2 characters and go directly for the other character in the third position like "D" and I wanted to skip both "B" and "C" character. Because I try the for loop to try to do that ,but it doesn't work because if I put in for(var i=0;i<this.length;i+=2)
{
nstring+=this string.charAt(i);
}
And I get AABBC... as a result.
Thanks for your help.