Reduce the number of characters in a string

Discussion in 'AutoCAD' started by coachball8, Jun 24, 2004.

  1. coachball8

    coachball8 Guest

    If I use (setq len1(strlen(getvar "dwgname"))) and it returns 23, is their a way to trim the number of characters in the string to 5? If not, how about this. The 5th character in the dwgname variable is always an alpha character depicting the size of the drawing. Can I use (vl-string-right-trim) to trim the number back to the alpha character? Any help is appreciated. TIA
     
    coachball8, Jun 24, 2004
    #1
  2. (setq string (getvar "dwgname"))
    "Drawing4.dwg"

    (substr string 1 5)
    "Drawi"


    --
    Autodesk Discussion Group Facilitator


    a way to trim the number of characters in the string to 5? If not, how about
    this. The 5th character in the dwgname variable is always an alpha character
    depicting the size of the drawing. Can I use (vl-string-right-trim) to trim
    the number back to the alpha character? Any help is appreciated. TIA
     
    Jason Piercey, Jun 24, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.