Ask a Question related to ASP, Design and Development.

  1. #1

    Default trim string

    How do i cut the last 4 characters in a string?
    I know how to cut the 4 first, but i need to cut the last!
    I have a image name like testimage.gif and I want to cut away .gif



    Thanks
    Christopher


    Christopher Brandsdal Guest

  2. Similar Questions and Discussions

    1. trim function
      Hi there, does any know how i can do a 'trim on canvas' sort of function. If my canvas is bigger than my draw/animation etc, then how do i shrink...
    2. Trim problem
      Hi, i have another complex problem i cannot figure out. I have a string called #file_name#. The string's value is a filepath and file name of a...
    3. Need to Trim value in a List
      I have a list that retrieves documents in a directory. <!--- Pack Directory ---> <cfdirectory action='list' directory='C:\TNS_Docs\EXCEL_PACKS'...
    4. Dynamic Text and Trim
      What exactly does the trim - right option do when selecting dynamic text from a database field? I used the option and Dreamweaver changed the code...
    5. Export To Layers AND Trim?
      Export to layers made my life a whole lot easier but I'm left with files that are as large as the original psd. I run a batch to trim afterwards but...
  3. #2

    Default Re: trim string

    If you just want to cut away the last four, use:

    TheString = Left(TheString, Len(TheString) - 4)

    If you want to get rid of the file extension, here is one of many ways:

    TheString = Left(TheString, InStrRev(TheString, ".") - 1)

    Ray at work

    "Christopher Brandsdal" <christopherwb@c2i.net> wrote in message
    news:%23Bh%23UM2VDHA.1832@TK2MSFTNGP09.phx.gbl...
    > How do i cut the last 4 characters in a string?
    > I know how to cut the 4 first, but i need to cut the last!
    > I have a image name like testimage.gif and I want to cut away .gif
    >
    >
    >
    > Thanks
    > Christopher
    >
    >

    Ray at Guest

  4. #3

    Default Re: trim string

    Christopher Brandsdal wrote on 31 jul 2003 in
    microsoft.public.inetserver.asp.general:
    > How do i cut the last 4 characters in a string?
    > I know how to cut the 4 first, but i need to cut the last!
    > I have a image name like testimage.gif and I want to cut away .gif
    vbscript:

    s = left(s,len(s)-4)

    jscript:

    s = s.substring(0,s.length-4)

    not tested

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

  5. #4

    Default Re: trim string

    Thank's to both of you!


    "Evertjan." <exjxw.hannivoort@interxnl.net> skrev i melding
    news:Xns93C99A8931991eejj99@194.109.133.29...
    > Christopher Brandsdal wrote on 31 jul 2003 in
    > microsoft.public.inetserver.asp.general:
    > > How do i cut the last 4 characters in a string?
    > > I know how to cut the 4 first, but i need to cut the last!
    > > I have a image name like testimage.gif and I want to cut away .gif
    >
    > vbscript:
    >
    > s = left(s,len(s)-4)
    >
    > jscript:
    >
    > s = s.substring(0,s.length-4)
    >
    > not tested
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)

    Christopher Brandsdal Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139