Using Split() in JScript

Results 1 to 3 of 3

Thread: Using Split() in JScript

  1. #1
    S Griff Guest

    Default Using Split() in JScript

    Take this line here. Is it legal<BR><BR>var myArray = split("myFilename.jpg", ".");<BR><BR>I&#039;m sure the array decleration is wrong.<BR><BR>This is in JAVASCRIPT. Not VBScript, so give me<BR>the answer in Javascript :)<BR><BR>Steve Griff

  2. #2
    pani Guest

    Default RE: Using Split() in JScript

    Hello sir,<BR> In javascript everything is an object so the code goes like this<BR>var str<BR>var s = yourstringname<BR>str = s.split(".")//or whatever u want <BR>now u can access them as <BR>str[0], str[1]

  3. #3
    Join Date
    Dec 1969

    Default RE: Using Split() in JScript

    Try doing it this way:-<BR><BR>completeString = "myFilename.jpg";<BR>partsSplit = completeString.split(".");<BR><BR>access the sections using<BR><BR>partsSplit[0], etc<BR><BR>Bob

Posting Permissions

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