Results 1 to 2 of 2

Thread: Find in string

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    California
    Posts
    115
    in my javascript, i grab the value of a the drop down menu, the value will look like, "34,myfile.txt"

    How can I get every right of the comma? the value could hold anything or be any length, I just need everything right of the comma..

    Is it possible in javascript?

    Thanks,
    Ryan

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    var myVar = "34,myfile.txt";
    var myNewVar = myVar.substring(myVar.indexOf(",",0)+1);
    alert(myNewVar);
    "People who think they know everything are a great annoyance to those of us who do."

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