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

Home » Public Forums » archive » Bug with string methods?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Bug with string methods? [message #89846] Wed, 10 December 2014 14:31 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
Am I misunderstanding the documentation, or is there a bug with some string methods?

When a string has more than one character, substring() works as I expected, from the documentation:

IDL> str='ab'
IDL> print,str.substring(-1)
b

But if the string has length 1, I get an empty string:

IDL> str='a'
IDL> print,str.substring(-1)

IDL> print,strlen(str.substring(-1))
0
IDL>

A similar problem happens with remove():

IDL> str='ab'
IDL> print,str.remove(-1)
a
IDL> str='a'
IDL> print,str.remove(-1)
a
[Message index]
 
Read Message
Read Message
Previous Topic: Request from the Far Beyond
Next Topic: EOF analysis of large data with NAN's

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

Current Time: Wed Oct 08 14:10:58 PDT 2025

Total time taken to generate the page: 0.00394 seconds