Trim a string

Results 1 to 3 of 3

Thread: Trim a string

  1. #1
    Join Date
    Dec 1969

    Default Trim a string

    I need to remove the extension from a filename. Is there a quick and painless way to do this? With the File object? With the string object? <BR><BR>.cs &#060;-- replaced with .dll or .exe

  2. #2
    Join Date
    Dec 1969

    Default One of the ways..

    to do it,<BR><BR>filename="test.asp"<BR>response.write replace(filename,mid(filename,(Instr(1,filename,". ")+1),len(filename)),"aspx")<BR><BR>Output -- test.aspx<BR><BR><BR><BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: One of the ways..

    Maybe you could go with instrrev() to get the first "." from the end of the string.

Posting Permissions

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