How to remove "(" and ")"

Discussion in 'AutoCAD' started by Adesu, Nov 29, 2004.

  1. Adesu

    Adesu Guest

    I have data like this (65 100 101 115 117) and then I want "65 100 101 115
    117",how to do that ?,thanks.
     
    Adesu, Nov 29, 2004
    #1
  2. Adesu

    Alaspher Guest

    Code:
    (vl-string-trim "()" (vl-princ-to-string '(65 100 101 115 117)))
    regards
     
    Alaspher, Nov 29, 2004
    #2
  3. Adesu

    Fatty Guest

    Hi again, Adesu
    Try this:

    (defun stritoa (lst / strn)
    (setq strn "")
    (while lst
    (setq strn (strcat strn (itoa (car lst)) " "))
    (setq lst (cdr lst)))
    strn
    )

    Test:
    (setq lsr '(65 100 101 115 117))
    Call:
    (stritoa lsr)
    Result:
    "65 100 101 115 117 "
     
    Fatty, Nov 29, 2004
    #3
  4. Adesu

    Adesu Guest

    Hi Alaspher & Fatty,yes I got what I look for,thanks a lot
     
    Adesu, Nov 29, 2004
    #4
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.