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?
Working with strings
-
ted
- Site Admin
- Posts: 6395
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
use StringFunctions to manipulate strings
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.
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.
-
mjb7
Can you concatenate strings with StringFunctions?
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?
-
mjb7
Use sprint for concatenation
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)
The following example will concatenate a & b into c:
strdef a,b,c
a = "foo"
b = "bar"
sprint(c,"%s%s",a,b)