Results 1 to 2 of 2

Thread: strings

  1. #1
    Joey Guest

    Default strings

    How do I parse over a string with vbscript?<BR><BR>I want to walk through the string and<BR>access certain areas.<BR>I have tried this<BR><BR>for i = 0 to LEN(string)<BR>response.write string(i)<BR>NEXT<BR><BR>but it gives me type mismatch errors.<BR><BR>Any clue<BR><BR>Joey

  2. #2
    Paul Mutton Guest

    Default RE: strings

    Joey,<BR><BR>try this:<BR><BR>Use the following function to nibble the first character<BR>from the string:<BR><BR> char = Left(stringname, 1)<BR><BR>Then use this to store the rest of it back into the original<BR>variable:<BR><BR> stringname = Right(stringname, len(stringname)-1)<BR><BR>Then you can keep doing "Response.Write(char)" until<BR>len(stringname) = 0<BR><BR>This is quite slow for extremely long strings, however.<BR>What do you wish to do this for, anyway?<BR><BR>Hope that helps,<BR><BR>

Posting Permissions

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