Results 1 to 2 of 2

Thread: Arrays

  1. #1

    Thread Starter
    Fanatic Member prog_tom's Avatar
    Join Date
    May 2001
    Location
    Los Angeles and Little Rock
    Posts
    810

    Post Arrays

    Suppose i have an array a:

    a[n] = n + b * c, i - p

    or simply

    a[n] = g, h

    how can i make it

    a[n] = h.

    In other words, how do I take out the g and the ",". ?

    And after take out g and the ",", suppose h = " hi", how do you take out the extra spaces before the hi.

    Thank you.

    prog_tom
    JOIN THE REVOLUTION!!!! Dual T3 backedup science community.
    http://physics.sviesoft.com/forum

  2. #2
    Lively Member
    Join Date
    Jun 2003
    Posts
    83
    Code:
    var b = a[n].split(',');
    if (b.length > 0) {
        var c = b[1];
        while (c.indexOf(' ') == 0) {
            c = c.substr(1, c.length - 1);
        }
        a[n] = c;
    }
    - Steve

    "I'm glad I wore these pants."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width