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

Home » Public Forums » archive » Re: IDL string trim
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: IDL string trim [message #61213 is a reply to message #61138] Tue, 08 July 2008 21:37 Go to previous message
raghuram is currently offline  raghuram
Messages: 32
Registered: February 2008
Member
On Jul 7, 7:43 am, mchin...@midway.uchicago.edu (Mike Chinander)
wrote:
> In article <MPG.22daffe956a87f7598a...@news.frii.com>,
> David Fanning  <n...@dfanning.com> wrote:
>
>
>
>
>
>> RussellGrew writes:
>
>>> This may not be the most elegant solution, but you can look at the
>>> size of k and add an extra zero to the string manually.
>
>>> eg for the variable 'tmp' being slotted into the filename,
>
>>> if k lt 10. then tmp = '0' + strtrim(string(k), 2) else k =
>>> strtrim(string(k), 2)
>
>>> I shall sit here and wait to be shot down by a more elegant solution.
>
>> I think this might be the elegant solution you are looking for:
>
>>   strVal = String(k, Format='(i2.2)')
>
>> Cheers,
>
>> David
>
> I usually use:
>
>      String(k, format='(I02)')
>
> which seems a little more intuitive (the zero indicating to zero-pad the string) but produces the same results as David's.
>
> --Mike
>
> --
> Michael Chinander
> m-chinan...@uchicago.edu
> Department of Radiology
> University of Chicago- Hide quoted text -
>
> - Show quoted text -

Hi all,

Thanks a lot. It works.

Raghu
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SHA-1, MD5, etc inquiry
Next Topic: Mapping image into a polar-square coordinate

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

Current Time: Wed Oct 08 18:44:30 PDT 2025

Total time taken to generate the page: 0.00426 seconds