Dividing strings (server variables)

Results 1 to 3 of 3

Thread: Dividing strings (server variables)

  1. #1
    `Christian Guest

    Default Dividing strings (server variables)

    Im using the server variable :<BR><BR>&#060;%=Request.ServerVariables("PATH_INF O") %&#062;<BR><BR>and as a result I get:<BR><BR>/automatisering/sub1/sub2/default.asp<BR><BR>Now what i have to do is put this text inside a string,<BR>but I want to create a string with the name of the directory where the file is in. In this case &#039sub2&#039. <BR><BR>I&#039ve tried myself silly but i can&#039t seem to solve the problem. I would be very thankfull if someone could help me!<BR><BR>Thank you very much in advance..<BR><BR>Christian Krijnen

  2. #2
    Eddie Campbell Guest

    Default RE: Dividing strings (server variables)

    &#060;% <BR>Dim MyPath, SubDir<BR>MyPath=Request.ServerVariables("PATH_INF O")<BR>SubDir=Left(MyPath,InstrRev(MyPath,"/")-1)<BR>SubDir=Right(SubDir,(Len(SubDir) - InstrRev(SubDir,"/")))<BR>Response.write SubDir<BR> %&#062;<BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: Dividing strings (server variables)

    Thank a lot man! You&#039re the greatest. You have completely solved my problem.....<BR><BR>Happy greetings from Christian

Posting Permissions

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