building string out of list of strings

Discussion in 'Cadence' started by Suresh Jeevanandam, Nov 30, 2005.

  1. In SKILL, I have a list of strings, and I want to build a new string
    with each string surrounded with double quotes.
    Eg.
    ll = list("a" "b" "c")

    buidString(ll)
    => "a b c" (<--Not what I want)

    buildString(mapcar(lambda((s) sprintf(nil "%L" s)) ll))
    => "\"a\" \"b\" \"c\"" (<-- This is what I wanted.)
    Is there any other better/simpler way of doing this?

    regards,
    Suresh
     
    Suresh Jeevanandam, Nov 30, 2005
    #1
  2. Well, your way isn't that bad - but here's another:

    strcat("\"" buildString(ll "\" \"") "\"")

    Andrew.
     
    Andrew Beckett, Nov 30, 2005
    #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.