Page 1 of 1

Working with strings

Posted: Thu Sep 01, 2005 8:21 am
by MishaZ
I have been trying to work with strings -- mainly, use them for saving and organizing data into files. But I haven't been able to figure out a way to combine, add strings or use any other string functions, like strcat() in C or "&" in VB...

Can anyone help?

use StringFunctions to manipulate strings

Posted: Thu Sep 01, 2005 11:08 am
by ted
Use the StringFunctions class to work with strings--see
http://www.neuron.yale.edu/neuron/stati ... trfun.html

"Imagine an alternate universe in which all life forms are computer programs. What
controversy would result if a copy of NEURON fell into the hands of local philosophers!
'Definitely shows signs of Intelligent Design,' assert the members of one school of
sapient subroutines.
Their opponents counter: 'Bah. It's all evolutionary accident. Look at these layers upon
layers of oddities. Doubles, strdefs, sections, objrefs, hoc and NMODL--how could
all that chaos possibly result from anything other than the accidental collision and
recombination of loosely articulated blocks of code over the eons?'"
But still it works.

Can you concatenate strings with StringFunctions?

Posted: Tue May 20, 2008 3:03 pm
by mjb7
I may be missing something, but I looked at the StringFunctions() page and I can't find anything about how to concatenate strings. Any ideas?

Use sprint for concatenation

Posted: Tue May 20, 2008 4:35 pm
by mjb7
Looking through some other posts I found you can use sprint to concatenate strings.

The following example will concatenate a & b into c:

strdef a,b,c
a = "foo"
b = "bar"
sprint(c,"%s%s",a,b)