mystring.split('.') versus substring(mystring,'.',/extract) [message #94764] |
Mon, 02 October 2017 02:49 |
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.
|
|
|