building string out of list of strings
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
building string out of list of strings

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Cadence
Author Message
Suresh Jeevanandam
Guest





Posted: Wed Nov 30, 2005 1:10 pm    Post subject: building string out of list of strings Reply with quote

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

Back to top
Andrew Beckett
Guest





Posted: Wed Nov 30, 2005 1:10 pm    Post subject: Re: building string out of list of strings Reply with quote

Well, your way isn't that bad - but here's another:

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

Andrew.
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Cadence All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB