building string out of list of strings

S

Suresh Jeevanandam

Guest
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
 
On Wed, 30 Nov 2005 14:57:23 +0530, Suresh Jeevanandam
<sureshj@DELETETHISti.com> wrote:

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
Well, your way isn't that bad - but here's another:

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

Andrew.
 

Welcome to EDABoard.com

Sponsor

Back
Top