Results 1 to 3 of 3

Thread: Scan until character found?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2003
    Location
    South Shields
    Posts
    3

    Scan until character found?

    Hi folks.

    I need some code done for this problem.

    Instead of;

    element would be; DM016A_RF_LIMS

    element=formName.LIMIT_lb.options[i].text
    compare=element.substr(0,5);

    I need;

    element=formName.LIMIT_lb.options[i].text
    compare=element (string up until the first underscore, NOT THE 1st FIVE CHARACTERS as above)

    ?

    Cheers
    Home is where the heart is.

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Try the indexOf method of String.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    Originally posted by CornedBee
    Try the indexOf method of String.
    ... Look it up on www.w3schools.com ...
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

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