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

Home » Public Forums » archive » mystring.split('.') versus substring(mystring,'.',/extract)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
mystring.split('.') versus substring(mystring,'.',/extract) [message #94764] Mon, 02 October 2017 02:49
trisb is currently offline  trisb
Messages: 18
Registered: November 2010
Junior Member
Hi everyone,

I have the following string

mystring = "MY.NESTED.FILENAME.ARGH"

What I want to do is split the string into substrings with the dot as the dividing character. Two methods area available but only one delivers:

This works:

IDL> out = strsplit(mystring,'.',/extract)
IDL> help,out
OUT STRING = Array[4]
IDL> print,out
MY NESTED FILENAME ARGH


This doesn't:

IDL> out = mystring.split('.')
IDL> help,out
OUT STRING = Array[24]
IDL> print,out



Any clue as to why the second one behaves that way? Note that this only happens with the dot, so I must be missing something fundamental.

Thanks,
F.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Algorithm 2A23 TRMM PR
Next Topic: IDL_STRING.split vs strsplit

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

Current Time: Wed Oct 08 09:07:49 PDT 2025

Total time taken to generate the page: 0.00379 seconds