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

Home » Public Forums » archive » checking a special character in a single string
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: checking a special character in a single string [message #93172 is a reply to message #93166] Thu, 05 May 2016 09:37 Go to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Thu, 5 May 2016 07:28:54 -0700 (PDT), Sapna Mishra wrote:

> Hello all,
>
> I have a string say:
> obj='J165248.4+363212.5'
>
> I want to know the place where my this + sign has come say here at 10th place .
>
> I did:
> n=where(strmatch(obj,'+*',/FOLD_CASE) EQ 1)
>
> but it is simply giving me n=1.
>
> can any one tell how to proceed ?
>
IDL> obj='J165248.4+363212.5'
IDL> print,strpos(obj,'+')
9

> Also if i want to remove all the numbers after '.' (decimal) how to do?
> with strjoin+strsplit it is simply removing decimal sign and clubbing all numbers together. I don't want numbers after decimal how to do???

IDL> print,strmid(obj,0,strpos(obj,'.'))
J165248

Cheers, Heinz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Visualize a Radar image with ENVI
Next Topic: Tool for converting FK4/FK5

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

Current Time: Sat Oct 11 07:13:28 PDT 2025

Total time taken to generate the page: 1.12193 seconds