Re: Array string [message #38124] |
Mon, 23 February 2004 09:30 |
Pavel Romashkin
Messages: 166 Registered: April 1999
|
Senior Member |
|
|
How about
strjoin(myArray, ' ')
Pavel
Julio wrote:
>
> Hi,
> I have an array string with 6 columns and 4 lines. In each array
> position I have words that I must extract. How can I do to transform
> this array in a 1 element string, with the words separated by spaces?
>
> Thanks in advance!
|
|
|
Re: Array string [message #38139 is a reply to message #38124] |
Sun, 22 February 2004 18:24  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Julio writes:
> I have an array string with 6 columns and 4 lines. In each array
> position I have words that I must extract. How can I do to transform
> this array in a 1 element string, with the words separated by spaces?
Just off the top of my head, how about something like this:
spaces = String(Replicate(32B,3)) ; Three spaces between words
words = Reform(array, 6*4)
line = words[0]
FOR j=1,N_Elements(words)-1 DO line = line + spaces + words[j]
Print, line
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|