< Back to IRCAM Forum

string and number

Hello,

How is it possible, please, to generate a string resulting from the concatenation of a string and a number? Ex: (string+ “foo” 1) gives an error (cannot coerce), as do the other (lower level) methods. I would like to generate “foo1” from the function above.
Thank you very much!

Hi,

with “format” function you can create strings according to the model you declare.
~A for alphanumeric
~D for decimals

it works like sprinf in max

Enjoy,

Emanuele

Hi,

Here’s another way…

Best,
RC

Hello, Emanuele and RC,

If course, I should have looked into the hard-core lisp functions to solve the riddle. Thank you for showing how to transform my numbers into strings!

Best,

Marco