comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » a simple question about strings
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: A simple question about strings [message #48082 is a reply to message #27012] Mon, 20 March 2006 10:53 Go to previous messageGo to previous message
liamgumley is currently offline  liamgumley
Messages: 74
Registered: June 2005
Member
Fritz wrote:
> Hello,
>
> The command
>> A = string(indgen(5))
> produces an array of five elements:
> [0 1 2 3 4 5]
>
> The command
>> B = '01234'
> produces an array of one element:
> 01234
>
> How to transform A so it becomes the same as B ?

Use STRJOIN, e.g.

IDL> a = strcompress(indgen(5), /remove_all)
IDL> help, a
A STRING = Array[5]
IDL> print, a
0 1 2 3 4
IDL> b = strjoin(a)
IDL> help, b
B STRING = '01234'
IDL> print, b
01234

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to debug seg fault.
Next Topic: how to exchange variable between modal dialog and the main window?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Nov 29 09:59:43 PST 2025

Total time taken to generate the page: 2.32383 seconds